WO2019196634A1 - Data processing method and apparatus - Google Patents

Data processing method and apparatus Download PDF

Info

Publication number
WO2019196634A1
WO2019196634A1 PCT/CN2019/079438 CN2019079438W WO2019196634A1 WO 2019196634 A1 WO2019196634 A1 WO 2019196634A1 CN 2019079438 W CN2019079438 W CN 2019079438W WO 2019196634 A1 WO2019196634 A1 WO 2019196634A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
address
virtual address
processing device
service processing
Prior art date
Application number
PCT/CN2019/079438
Other languages
French (fr)
Chinese (zh)
Inventor
汪明
陈平
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2019196634A1 publication Critical patent/WO2019196634A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/10Address translation
    • G06F12/1009Address translation using page tables, e.g. page table structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/20Processor architectures; Processor configuration, e.g. pipelining

Definitions

  • the present invention relates to the field of data processing technologies, and in particular, to a data processing method, apparatus, and computer readable medium.
  • a typical scene such as panoramic video playback
  • the GPU and the decoder used in a video playback device respectively use different compression technologies, for example, the GPU adopts a first compression technology, and the decoder uses a second compression technology, a first compression technique, and a second. If the compression technique is different, the data decoded by the decoder cannot be directly sent to the GPU for processing.
  • the GPU cannot recognize or directly use the data output by the decoder.
  • This problem is more common when the decoder and GPU are provided by different vendors. It can be seen that when the GPU and a certain functional module are incompatible, the GPU cannot recognize the data output by the function module, and the data that is not recognized or used by the GPU needs to be converted into data that the GPU can recognize or use and output to the GPU.
  • FIG. 1 is a schematic flowchart of converting data that is not recognized or used by a GPU into data that can be recognized or used by a GPU and output to a GPU. As shown in FIG.
  • 101 denotes data that the GPU does not recognize or use
  • 102 denotes a service processing device
  • 103 denotes data that the GPU can recognize or use
  • 104 denotes a GPU.
  • the service processing device converts data that is unrecognizable or used by the GPU into data that the GPU can recognize or use, and stores the data in the memory
  • the GPU reads the identifiable or used data from the memory through the bus.
  • the business processing device needs to write the data that the output GPU can recognize or use to the memory, and the GPU needs to read the identifiable or used data from the memory.
  • the present application provides a data processing method and apparatus for conserving system bandwidth in converting data that is unrecognizable or used by a GPU into data that the GPU can recognize or use and output to the GPU.
  • the first aspect of the present invention provides a data processing apparatus, including: a graphics processor, a service processing device, and a first memory management unit (MMU); the graphics processor and the first memory management The unit is respectively coupled to the service processing device; the graphics processor is configured to request first data corresponding to the first virtual address, the first data is data processed by the service processing device and can be used by the graphics processor
  • the service processing device is configured to convert the first virtual address into a second virtual address and output the second virtual address to the first memory management unit, where the second virtual address corresponds to And the first memory management unit is configured to search for a first physical address corresponding to the second virtual address according to the first mapping table; and the service processing device is further used by the service processing device.
  • the data processing device is coupled to the memory via a bus; the service processing device is further configured to process the second data to obtain the first data, in the absence of the bus or one of the memories or The first data is output to the graphics processor in the case of full participation.
  • the second data and the first data are data of different types or formats.
  • the service processing apparatus is configured to convert the second data into the first data to enable the graphics processor to use the first data.
  • the service processing apparatus includes at least one of: a decompression unit, a compression unit, a decryption unit, or an encryption unit.
  • the business processing apparatus may perform at least one of a decompression operation, a compression operation, a decryption operation, or an encryption operation.
  • a typical example of the service processing device is a decompression unit.
  • the service processing device can implement various data processing operations and can be applied to multiple scenarios.
  • the first memory management unit may map the second virtual address to the first physical address according to the first mapping table.
  • the first mapping table includes a correspondence between at least one virtual address and at least one physical address.
  • the service processing apparatus may implement an address translation function to convert the first virtual address into the second virtual address.
  • the first mapping table may be configured for driver software running by the graphics processor or other processor.
  • the service processing device acquires the second data, processes the second data to obtain the first data, and outputs the first data to the graphics processor.
  • Data that is unrecognizable or used by the GPU can be converted to and recognized by the GPU and output to the graphics processor, saving system bandwidth.
  • the channel for transmitting the second data between the service processing device and the graphics processor is an interface other than the bus.
  • the device is an integrated circuit.
  • a virtual address translation method is provided, where the service processing device is further configured to obtain service information, where the service information includes converting the first virtual address to the Information required by the second virtual address; the service processing device is specifically configured to convert the first virtual address into the second virtual address according to the service information.
  • the first virtual address corresponds to the first data
  • the second virtual address corresponds to the second data.
  • the service processing device processes the second data to obtain the first data. Converting, by the service processing device, the first virtual address to the second virtual address may be understood by the service processing device determining, according to a virtual address corresponding to the first data that is required to be output to the graphics processor, Obtaining a virtual address corresponding to the second data required by the first data.
  • the first data is data to be outputted by the service processing device, that is, data to be output to the graphics processor.
  • the service processing device may convert the virtual address corresponding to the data to be output into a virtual address corresponding to the data required to obtain the data to be output, so that the service processing device obtains the data to be output, which is simple to implement.
  • the data processing apparatus further includes a second memory management unit coupled between the graphics processor and the service processing device; the graphics processor is specifically configured to The second memory management unit sends a first data acquisition request, where the first data acquisition request includes a third virtual address, the third virtual address is used to indicate the first virtual address, and the second memory management unit is used by And searching for the first virtual address corresponding to the third virtual address according to the second mapping table, and further requesting, by the service processing device, the first data corresponding to the first virtual address.
  • the second memory management unit is coupled to the graphics processor and the service processing device, respectively.
  • the second mapping table may be configured for driver software running by the graphics processor or other processor.
  • the second mapping table includes a mapping relationship of at least one virtual address to a virtual address.
  • the second mapping table may further include a correspondence between at least one virtual address and at least one physical address. The first virtual address and the third virtual address are the same.
  • the graphics processor requests data from the service processing device through the second memory management unit, so as to obtain data output by the service processing device, which is simple in implementation and strong in compatibility.
  • the graphics processor performs at least one of: generating the service information, configuring the first mapping table, or configuring the second mapping table by running driver software.
  • the graphics processor performs operations such as generating the service information, configuring the first mapping table, or configuring the second mapping table by running driver software, so that the graphics processor obtains the required data.
  • the service information generated by the driver software corresponds to data requested by the graphics processor.
  • the graphics processor generates service information, configures the first mapping table, or configures the second mapping table by running the driver software, so as to satisfy various data acquisition requests sent by the graphics processor, and has high flexibility and can meet different applications. The needs of the scene.
  • the service processing device is specifically configured to receive the first physical address input by the first memory management unit, output the first physical address to a bus controller, and receive The second data output by the bus controller, the bus controller being coupled to the memory via the bus.
  • the data processing apparatus further includes an address filter coupled between the second memory management unit and the service processing device, and the second memory management unit is specifically configured to The address filter sends the first virtual address; the address filter is configured to receive the first virtual address, and if the first virtual address is in a target address interval, the first virtual The address is output to the service processing device.
  • the address filter outputs an address in the target address interval to the service processing device, and an address not in the target address interval is not output to the service processing device.
  • the address filter outputs the address in the target address range to the service processing device, which can reduce the processing load of the service processing device.
  • the graphics processor is further configured to send a second data acquisition request to the second memory management unit, where the second data acquisition request includes a fourth virtual address; a memory management unit, configured to: search a second physical address corresponding to the fourth virtual address according to the second mapping table, and send the second physical address to the address filter; the address filter, further And receiving the second physical address, where the second physical address is not in the target address interval, acquiring third data stored in the second physical address by using a bus controller, and outputting the first Three data to the graphics processor.
  • the address filter acquires data stored at an address that is not in the target address range through the bus controller, and outputs the data to the graphics processor; the data requested by the graphics processor can be quickly output to the graphics processor.
  • the present application provides a data processing method for a data processing apparatus, the data processing apparatus comprising a graphics processor, a service processing apparatus, and a first memory management unit coupled in sequence, the method comprising: the graphics The processor requests first data corresponding to the first virtual address, the first data is data processed by the service processing device and can be used or recognized by the graphics processor; the service processing device will be the first Converting the virtual address to the second virtual address and outputting the second virtual address to the first memory management unit, where the second virtual address corresponds to the second data before the processing by the service processing device; the first memory The management unit searches for a first physical address corresponding to the second virtual address according to the first mapping table; the service processing device acquires the second data stored in the first physical address in the memory, the second Data cannot be used or identified by the graphics processor, the data processing device being coupled to the memory via a bus; Second means for processing said first data to obtain the data, in a case where there is no bus or the memory or all of the participating the output of the first data to the
  • the service processing device acquires the second data, processes the second data to obtain the first data, and outputs the first data to the graphics processor.
  • the converting, by the service processing device, the first virtual address to the second virtual address includes: the service processing device acquiring service information; the service information including the first virtual address Converting information required for the second virtual address; the service processing device converting the first virtual address to the second virtual address according to the service information.
  • the service processing device may convert the virtual address corresponding to the data to be output into a virtual address corresponding to the data required to obtain the data to be output, so that the service processing device obtains the data to be output, which is simple to implement.
  • the data processing apparatus further includes a second memory management unit coupled to the graphics processor;
  • the first data corresponding to the first virtual address by the graphics processor includes:
  • the graphics processor sends a first data acquisition request to the second memory management unit, the first data acquisition request includes a third virtual address, and the third virtual address is used to indicate the first virtual address;
  • the second memory management unit searches for the first virtual address corresponding to the third virtual address according to the second mapping table, and further requests the first data corresponding to the first virtual address to the service processing device.
  • the graphics processor requests data from the service processing device through the second memory management unit, so as to obtain data output by the service processing device, which is simple in implementation and strong in compatibility.
  • the method further includes performing at least one of: generating the service information, configuring the first mapping table, or configuring the second mapping table.
  • the graphics processor generates service information by running the driver software, configures the first mapping table, or configures the second mapping table, etc., so as to satisfy various data acquisition requests sent by the graphics processor, and the flexibility is high.
  • the acquiring, by the service processing device, the second data stored in the first physical address in the memory comprises: receiving, by the service processing device, the input by the first memory management unit Decoding a first physical address; outputting the first physical address to a bus controller and receiving the second data output by the bus controller, the bus controller being coupled to the memory via the bus.
  • the data processing apparatus further includes an address filter coupled to the second memory management unit and the service processing device, respectively; the service processing device converts the second virtual address Before the third virtual address, the method further includes: the second memory management unit sends the first virtual address to the address filter; and the address filter receives the input by the second memory management unit Describe a first virtual address; if the first virtual address is in a target address interval, output the first virtual address to the service processing device.
  • the address filter outputs the address in the target address range to the service processing device, which can reduce the processing load of the service processing device.
  • the method further includes: the graphics processor sending a second data acquisition request to the second memory management unit, where the second data acquisition request includes a fourth virtual address;
  • the second memory management unit searches for the second physical address corresponding to the fourth virtual address according to the second mapping table and sends the second physical address to the address filter;
  • the address filter receives the first a second physical address, where the second physical address is not in the target address interval, acquiring third data stored in the second physical address by using a bus controller, and outputting the third data to the graphic processor.
  • data stored at an address that is not in the target address range is acquired by the bus controller and output to the graphics processor; the data requested by the graphics processor can be quickly output to the graphics processor.
  • the service processing apparatus includes at least one of: a decompression unit, a compression unit, a decryption unit, or an encryption unit.
  • the service processing device can implement various data processing operations and can be applied to multiple scenarios.
  • the present application provides a computer readable storage medium storing a computer program, the computer program comprising program instructions, the program instructions being executed by a graphics processor
  • the operations of generating the service information, configuring the first mapping table, or configuring the second mapping table in the first aspect and the second aspect described above are performed.
  • FIG. 1 is a schematic flow chart of converting data that is not identifiable or used by a GPU into data that can be recognized or used by a GPU and outputting to a GPU;
  • FIG. 2 is a schematic structural diagram of a terminal provided by the present application.
  • FIG. 3 is a schematic flowchart of converting data that is unrecognizable or used by a GPU into data that can be recognized or used by a GPU and outputting the same to the GPU;
  • FIG. 4 is a schematic structural diagram of a data processing apparatus provided by the present application.
  • FIG. 5 is a schematic structural diagram of original data and compressed data provided by the present application.
  • FIG. 6 is a schematic structural diagram of another data processing apparatus provided by the present application.
  • the present application provides a data processing method and apparatus for saving system bandwidth.
  • the data processing apparatus and method provided by the present application can be applied to a GPU-containing device such as a desktop computer, a notebook computer, a television, a mobile phone, a tablet computer, a personal digital assistant, a wearable device, a game machine, or a video camera.
  • the system bandwidth can include one or all of bus bandwidth or read and write bandwidth of the memory.
  • FIG. 2 is a schematic structural diagram of a terminal according to an embodiment of the present application.
  • the terminal 200 can include a system chip 210, a memory 215 (one or more computer readable storage media), a radio frequency (RF) module 216, and a peripheral system 217. These components can communicate over one or more communication buses 214.
  • a system chip 210 one or more computer readable storage media
  • a radio frequency (RF) module 216 one or more computer readable storage media
  • RF radio frequency
  • the peripheral system 217 is mainly used to implement the interaction function between the terminal 200 and the user/external environment, and mainly includes the input and output devices of the terminal 200.
  • the peripheral system 217 can include: a touch screen controller 218, a camera controller 219, an audio controller 220, and a sensor management module 221. Each controller may be coupled to a respective peripheral device such as touch screen 223, camera 224, audio circuit 225, and sensor 226. It should be noted that the peripheral system 217 may also include other I/O peripherals.
  • the system chip 210 may include a central processing unit 211, a graphics processor 227, a clock module 222, and a power management module 213.
  • the central processing unit 211 and the graphics processing unit 227 can be integrated into one integrated circuit or separate devices.
  • the graphics processor 227 can be configured with one or more memory management units and further integrated with the business processing device, which can perform operations such as reading, writing, decompressing, decrypting, compressing, and encrypting so that the acquired external
  • the data is converted to data that the graphics processor 227 can recognize or use.
  • the clock module 222 integrated in the system chip 210 is mainly used to generate a clock required for data transmission and timing control for the central processing unit 211.
  • the power management module 213 integrated in the system chip 210 is mainly used to provide a stable, high-accuracy voltage for the central processing unit 211, the radio frequency module 216, and the peripheral system.
  • the system chip 210 can further include a bus controller (not shown in FIG. 2) for managing the communication bus 214.
  • the bus 214 involved in this embodiment may include various types of buses, such as a serial bus, a parallel bus, an Inter-Integrated Circuit (I2C) bus, or a peripheral component interconnect express (PCIe) bus. Etc., used to couple different components or modules in the system.
  • the system chip 210 in this embodiment is merely an example, and various internal components or functions may be replaced by a plurality of chips or other separate components.
  • a radio frequency (RF) module 216 is used to receive and transmit radio frequency signals, primarily integrating the receiver and transmitter of terminal 200.
  • a radio frequency (RF) module 216 communicates with the communication network and other communication devices via radio frequency signals.
  • the radio frequency (RF) module 216 can include, but is not limited to: an antenna system, an RF transceiver, one or more amplifiers, a tuner, one or more oscillators, a digital signal processor, a CODEC chip, a SIM card, and Storage media, etc.
  • a radio frequency (RF) module 216 can be implemented on a separate chip.
  • Memory 215 is coupled to central processor 211 for storing various software programs and/or sets of instructions.
  • memory 215 can include high speed random access memory, and can also include non-volatile memory, such as one or more magnetic disk storage devices, flash memory devices, or other non-volatile solid state storage devices.
  • the memory 215 can store an operating system (hereinafter referred to as a system) such as an embedded operating system such as ANDROID, IOS, WINDOWS, or LINUX.
  • the memory 215 can also store a network communication program that can be used to communicate with one or more additional devices, one or more terminal devices, one or more network devices.
  • the memory 215 can also store a user interface program, which can realistically display the content of the application through a graphical operation interface, and receive user control operations on the application through input controls such as menus, dialog boxes, and keys. .
  • the memory 215 can also store one or more applications. As shown in FIG. 2, these applications may include: social applications (such as Facebook), image management applications (such as photo albums), map applications (such as Google Maps), browsers (such as Safari, Google Chrome), etc. .
  • social applications such as Facebook
  • image management applications such as photo albums
  • map applications such as Google Maps
  • browsers such as Safari, Google Chrome
  • central processor 211 can be used to read and execute computer readable instructions. Specifically, the central processing unit 211 can be used to call a program stored in the memory 215 and execute the instructions contained in the program.
  • the graphics processor 227 can be used to perform various operations required to draw computer graphics, including vertex settings, lighting, pixel operations, and the like.
  • terminal 200 is only an example provided by an embodiment of the present invention, and that the terminal 200 may have more or less components than the illustrated components, may combine two or more components, or may have components. Different configurations are implemented.
  • FIG. 3 is a schematic flowchart of converting data that is unrecognizable or used by a GPU into data that can be recognized or used by a GPU, that is, converting data of one type or format into another type or format. Does not change the data content.
  • 301 represents data that the GPU does not recognize or use
  • 302 represents a GPU integrated with the service processing device
  • 303 represents data output by the GPU.
  • the business processing device can convert data that is unrecognizable or used by the GPU into data that the GPU can recognize or use without changing the data content and output to the GPU.
  • the service processing device Since the service processing device is integrated with the GPU, the service processing device does not need to go through the bus to transmit data to the GPU, and the operation of reading and writing the memory can be omitted compared with the prior art, thereby achieving the goal of saving system bandwidth. Since the service processing device can directly transmit the obtained data to the graphics processor, the data need not be stored in an external memory and then read by the graphics processor from the memory, which can reduce the system. Memory consumption and bandwidth consumed by memory reads and writes.
  • the graphics processor also known as the display core, the visual processor, and the display chip
  • the graphics processor is an image computing operation specially performed on a personal computer, a workstation, a game machine, and some mobile devices (such as a tablet computer or a smart phone).
  • the processor or microprocessor that is working.
  • the data processing apparatus may include one or more of a hardware accelerator, a logic circuit, or dedicated hardware for implementing data conversion.
  • FIG. 4 is a schematic structural diagram of a data processing apparatus provided in the present application.
  • the apparatus may be located in the system chip 210, for example, a part of an integrated circuit inside the system chip 210.
  • the device may also be the system chip 210 itself or the terminal 200 in FIG.
  • the specific embodiment of the data processing device is not specifically limited in this embodiment.
  • the data processing apparatus of FIG. 4 may include a graphics processor 410, a service processing apparatus 420, a first memory management unit 430, and a bus controller 440.
  • the business processing device 420 is coupled to the graphics processor 410, the first memory management unit 430, and the bus controller 440, respectively.
  • the graphics processor 410 and the service processing device 420 are integrated. As shown in FIG.
  • the data processing apparatus in the present application can implement the following operations: 401.
  • the graphics processor 410 or other driver software running by the processor configures the first mapping table for the first memory management unit 430.
  • the first mapping table includes a correspondence between at least one virtual address and at least one physical address.
  • the other processor may be a central processing unit (CPU) or other type of processor device that can execute the driver software.
  • the graphics processor 410 requests the service processing device 420 for the first data corresponding to the first virtual address.
  • the first data is data processed by the business processing device 420 and can be used or recognized by the graphics processor 420.
  • VA in Fig. 4 represents the first virtual address. 403.
  • the service processing device 420 converts the first virtual address into a second virtual address and outputs the second virtual address to the first memory management unit 430.
  • the second virtual address corresponds to the second data before the processing by the service processing device 420.
  • the second data may be stored in a memory external to the data processing device, may be the memory 215 as shown in FIG. 2, or may be a buffer or an on-chip memory in the system chip 210.
  • the data processing device is coupled to the memory via a bus.
  • VA' in Fig. 4 denotes a second virtual address. 404.
  • the first memory management unit 430 searches for a first physical address corresponding to the second virtual address according to the first mapping table, and outputs the first physical address to the service processing device 420.
  • the PA in Fig. 4 represents the first physical address.
  • the service processing device 420 outputs the first physical address to the bus controller 440. 406, the service processing device 420 receives second data from the bus controller 440, the second data and The first data is of a different type or format, so the second data cannot be directly used or recognized by the graphics processor 420. 407.
  • the service processing device 420 processes the second data to obtain first data, and outputs the first data to the graphics processing without one or all of the bus or the memory participating. 410, to enable the graphics processor 410 to identify and use the first data. For example, the first data provided by the business processing device 420 to the graphics processor 410 does not pass through the bus and the memory.
  • the bus and the memory are not involved in the transmission of the first data, so that the bus bandwidth is saved, and the storage space of the memory and the bandwidth of the read-write memory are also saved. Saves on total system bandwidth.
  • the channel through which the service processing device 420 transmits the first data to the graphics processor 410 is an interface other than a bus, such as a dedicated circuit interface.
  • the address in the memory has a virtual address and a physical address
  • the processor or other device accesses the data in the memory through the address.
  • information is stored in bytes in memory.
  • each byte unit is given a unique memory address, called a physical address.
  • the physical addresses are numbered starting from 0, sequentially incremented by one each time, so the physical address space of the memory grows linearly.
  • the physical address is the address signal used to address the memory locations in the memory and is the end result of the address translation.
  • the external bus of the processor can be coupled to the memory through the pins of the system chip 210.
  • the virtual address is generated by the compiler and is the logical address of the program.
  • the above processors may be CPUs, GPUs, and other processors.
  • the virtual memory management mechanism requires the support of the memory management unit.
  • the memory management unit can usually be considered as part of a CPU or GPU, or it can be selectively located outside of the CPU or GPU, ie as a standalone device. If the CPU or GPU does not have a memory management unit, or has a memory management unit but is not enabled, the memory address issued by the CPU or GPU execution unit will be directly transferred to the chip pins, such as the pins of the system chip 210, and the actual physical memory. For example, it is received by the memory 215 or the buffer in the system chip 210 or the on-chip memory, which is called a physical address (PA).
  • PA physical address
  • the memory address issued by the CPU or GPU execution unit will be intercepted by the memory management unit.
  • the address from the CPU or GPU to the memory management unit is called the virtual address (VA), and the memory management unit.
  • VA virtual address
  • the memory management unit Translate this address into another address and send it to the external address pin of the chip where the CPU or GPU is located, that is, map the virtual address to a physical address.
  • the memory management unit is responsible for the mapping of virtual addresses to physical addresses. It can be understood that the memory management unit can map the virtual address corresponding to each process to the physical address space corresponding to the process, so that each process, such as a CPU process or a GPU process, has its own independent physical address space.
  • the physical address actually generated by the memory management unit is typically a discrete discrete address
  • the virtual address is a logical address for the CPU or GPU that uses the address, making the logical address appear to be more contiguous. Therefore, in virtual memory management, a memory management unit is used to implement conversion between an external memory address to an internal device, such as a usable and identifiable address of a CPU or GPU.
  • the memory management unit can also provide memory access check of the hardware mechanism. The memory access permission check can protect the memory in the memory used by each process from being destroyed by other processes.
  • the memory management unit can provide a memory access permission check on the hardware mechanism of the GPU, and the memory in the memory used by the process protecting the GPU is not destroyed by other processes.
  • business processing device 420 is integrated with graphics processor 410 and coupled to an external bus via bus controller 440 for further coupling to a memory external to the data processing device.
  • the channel between the service processing device 420 and the graphics processor 410 for transmitting data is an interface other than the bus. Therefore, the data transfer between the service processing device 420 and the graphics processor 410 does not have to go through the bus or external memory, for example, neither the bus nor the external memory participate in the data transmission, saving system bandwidth including bus bandwidth and memory bandwidth.
  • a virtual address translation method is provided, as follows: the service processing device 420 is further configured to acquire service information; and the service information includes converting the first virtual address into a Information required for the second virtual address; the service processing device 420 is specifically configured to convert the first virtual address into the second virtual address according to the service information.
  • the service information includes at least one of: an image start virtual address, a resolution, an image format, a step size, or compression header information.
  • the service processing device 420 may be at least one of a decompression unit, a compression unit, an encryption unit, or a decryption unit.
  • the service processing device 420 may perform at least one of various operations such as a decompression operation, a compression operation, a decryption operation, or an encryption operation.
  • the service processing device 420 is a decompression unit for decompressing data in one compressed format, such as second data, into data in another compressed format, such as the first data. The conversion between these two formats does not change the specific content of the data.
  • the service information in this embodiment may be generated by the driver software running by the graphics processor.
  • the graphics processor 410 or other processor-driven driver software can generate a variety of service information.
  • the service processing device 420 can obtain corresponding service information according to the data requested by the graphics processor 410. For example, the graphics processor 410 requests the encrypted data, the graphics processor 410 or other driver software running by the processor generates the first service information, and the service processing device 420 acquires the first service information, where the first service information includes The virtual address corresponding to the encrypted data is converted into information required for the virtual address corresponding to the unencrypted data.
  • the graphics processor 410 requests to decompress data
  • the graphics processor 410 or other driver software running by the processor generates second service information
  • the service processing device 420 acquires the second service information, where the second service information includes
  • the virtual address corresponding to the uncompressed data is converted into information required for the virtual address corresponding to the compressed data.
  • the service information corresponds to data requested by the graphics processor 410 and operations that the service processing device 420 needs to perform.
  • the service processing device 420 can perform different operations, but the principles of address translation are similar. A specific example of the address conversion method employed when the service processing device 420 performs the decompression operation as the decompression unit will be described below.
  • the second data is data before decompression, such as Hisilicon Frame Buffer Compression (HFBC) format data.
  • the first data is decompressed data, which can be used and recognized by the graphics processor, for example, ARM (Advanced RISC Machine, Advanced Framed Instruction Set Machine) frame compression (AFBC) format data.
  • ARM Advanced RISC Machine, Advanced Framed Instruction Set Machine
  • Step 1 The service processing device 420 acquires target service information.
  • the target service information may include an image start virtual address, a resolution, an image format, a step size, and compressed header information.
  • the service information corresponding to the video image data with a resolution of 1280 ⁇ 720 includes: an image start virtual address 0x8000000000, a width 1280, a height 720, a step size 1280, and compression header information.
  • Step 2 The service processing device 420 determines target coordinates of the first data corresponding to the first virtual address in the image.
  • the first virtual address is 0x8000004000
  • the image starting virtual address is 0x8000000000
  • the first data is located in the image.
  • Step 3 Determine the target data block corresponding to the target coordinate in the original data.
  • the raw data includes the first data.
  • the original data is data processed by the service processing device 420, that is, uncompressed data.
  • FIG. 5 is a schematic structural diagram of original data and compressed data provided by the present application.
  • 501 represents original data
  • 502 represents compressed data
  • 501 includes each rectangle representing a 16 ⁇ 16 data block
  • 502 is divided into two parts
  • the upper part is an index address
  • the lower part is compressed data
  • the lower part is compressed data
  • 503 indicates The data block of the Mth column of one row
  • 504 represents the index address corresponding to the compressed data of the first row and the Mth column
  • 505 represents the compressed data of the first row and the Mth column.
  • the original data in FIG. 5 corresponds to the compressed data
  • the business processing device 420 decompresses the compressed data to obtain the original data.
  • the original data and the compressed data correspond to the same starting address, that is, the virtual address corresponding to the data block of the first row and the first column in 501 is the same as the virtual address corresponding to the index address of the first row and the first column of 502.
  • each data block included in the original data corresponds to one index address
  • each index address corresponds to one compressed data.
  • 503 in FIG. 5 corresponds to 504, and 504 corresponds to 505.
  • the target coordinate is (1024, 12)
  • the size of each data block in the original data is 16 ⁇ 16
  • the data block corresponding to the target coordinate point is the block PQ.
  • the target coordinate point corresponds to the data block of the first row and the 64th column in FIG.
  • Step 4 Determine a second virtual address corresponding to the target data block.
  • the following is a specific example of determining the virtual address of the compressed data corresponding to the data block of the first row and the 64th column in the original data:
  • VA’_header VA’_start+byte(header) ⁇ 64;(1)
  • VA’_body VA’_start+data(pa_header);(2)
  • VA'_start represents the starting virtual address of the compressed data, that is, the virtual address corresponding to the index address of the first row and the first column in FIG. 5;
  • byte (header) represents the number of bytes occupied by one index address;
  • VA'_header represents The data address corresponds to an index address;
  • data (pa_header) represents the address stored by the VA'_header;
  • VA'_body represents the virtual address of the compressed data corresponding to the data block, that is, the second virtual address.
  • the target data block is the data block of the first row and the 64th column in the original data, that is, 503 in FIG. 5, and the service processing device calculates the index address corresponding to the target data block by using the formula (1), and obtains the index address in FIG.
  • the virtual address corresponding to the virtual address is obtained by using the virtual address stored in the virtual address, and the virtual address corresponding to the compressed data corresponding to the data block is calculated by using the formula (2) and the reference virtual address to obtain a virtual address corresponding to the 505.
  • the business processing device 420 can include a coordinate locator, an address translator, and a decompression module.
  • the coordinate locator is configured to determine target coordinates of the first data corresponding to the first virtual address in the image.
  • the address converter is configured to implement conversion of the first virtual address to the second virtual address, that is, steps 2 to 4.
  • the decompression module is configured to decompress the acquired compressed data.
  • the above describes a virtual address translation method.
  • the operations performed by the service processing device 420 are different, and different address translation modes may be adopted.
  • the virtual address corresponding to the unencrypted third data is converted into the virtual address corresponding to the encrypted fourth data, and the service processing device 420 decrypts the fourth data to obtain the third data.
  • the service processing device 420 can convert the virtual address corresponding to the data to be output into a virtual address corresponding to the data required to obtain the data to be output, so that the service processing device 420 obtains the data to be output, which is simple to implement.
  • FIG. 6 is a schematic structural diagram of another data processing apparatus provided by the present application, which is based on the apparatus shown in FIG. 4 and further refined.
  • the data processing device can be an integrated circuit located in the system chip 210.
  • the data processing apparatus includes a graphics processor 620, a second memory management unit 630, an address filter 640, a service processing device 650, a first memory management unit 660, and a bus controller 670.
  • the graphics processor 620, the second memory management unit 630, the address filter 640, the service processing device 650, and the first memory management unit 660 are sequentially coupled, and the service processing device 650 and The bus controller 670 is coupled.
  • the data processing apparatus may perform the following operations: 601, the graphics processor 620 or other driver software running the driver software to configure the first mapping table or the second mapping table.
  • the first mapping table is applied to the first memory management unit 660; the second mapping table is applied to the second memory management unit 630.
  • the first mapping table is used to implement mapping of virtual addresses to physical addresses.
  • the second mapping table is used to implement mapping of the virtual address system target address. If the target address needs to be further converted to a physical address by another memory management unit or mapping table, the target address is a virtual address. Alternatively, the target address can be a physical address without further conversion by other memory management units or mapping tables.
  • the second mapping table may include a mapping relationship of at least one virtual address to a virtual address, and may further include a correspondence between at least one virtual address and at least one physical address.
  • the first mapping table or the second mapping table may be dynamically configured by the driver software according to an occupation of a memory.
  • the graphics processor sends a first data acquisition request to the second memory management unit 630.
  • the first data acquisition request includes a third virtual address. 603.
  • the second memory management unit 630 searches for a target address corresponding to the third virtual address according to the second mapping table, and further sends the target address to the address filter 640.
  • the address filter 640 is used for filtering or filtering to identify a particular address.
  • the address filter 640 outputs the target address to the service processing device 650, and the address not in the target address interval is not sent to the service.
  • Processing device 650 outputs. .
  • the target address is the first virtual address mentioned in the previous embodiment. 605.
  • the service processing device 650 further converts the target address into a second virtual address and outputs the second virtual address to the first memory management unit 660.
  • the second virtual address corresponds to the second data before the processing by the service processing device 650.
  • the target address corresponds to the first data processed by the service processing device 650.
  • VA in Fig. 6 denotes the third virtual address
  • VA' denotes the target address
  • VA" denotes the second virtual address.
  • the target address interval may be preset for the address filter
  • An address range of the image processor may be an address range of the driver software configuration run by the graphics processor or other processor.
  • the address in the target address interval may be a virtual address, and the address not in the target address interval may be The physical address can be implemented by the address filter to distinguish the physical address from the virtual address.
  • the first memory management unit 660 searches for a first physical address corresponding to the second virtual address according to the first mapping table, and outputs the first physical address to the service processing device 650.
  • the PA in Fig. 6 represents the first physical address. 607.
  • the service processing device 650 outputs the first physical address to the bus controller 670.
  • the service processing device 650 receives the second data from the bus controller 670. 609.
  • the service processing device 650 processes the second data to obtain the first data, and outputs the first data to the graphics processor 620.
  • the address filter 640 outputs the target address to the bus controller 670, where the target address is the second physical address.
  • the data stored by the second physical address is data requested by the graphics processor 620. 611.
  • the graphics processor 620 receives data that the bus controller 670 acquires and transmits in response to the second physical address. Since the address received by the address filter 640 may be an address that the service processing device 650 does not need, such as a physical address, once the address filter 640 outputs the address to the service processing device 650, the The business processing device 650 has unnecessary operations and even adverse effects. Therefore, the address filter 640 outputs only the address in the target address range to the service processing device 650, avoiding waste of resources.
  • the address filter 640 is configured to filter the address generated by the second memory management unit 630, and provide an address within the target address range to the service processing device 650 for the address to be converted by the service processing device 650.
  • the address filter 640 provides an address that is not within the target address range to the bus controller 670 such that the associated address is used directly as a physical address. Therefore, for the second memory management unit 630, the generated address within the target address range is another virtual address or another logical address, and the second memory management unit 630 implements the virtual address to the virtual address. Mapping, virtual addresses before and after mapping can be essentially the same.
  • another virtual address generated after the mapping may be different from the virtual address before the mapping, for example, some information is added, including but not limited to an identifier corresponding to different software processes or an identifier indicating service information corresponding to the address. So that the virtual address generated after mapping is different from the virtual address before mapping.
  • the second memory management unit 630 If the second memory management unit 630 generates an address that is not in the target address range, as in another address interval, it is used to implement mapping of the virtual address to the physical address, and the address output by the second memory management unit 630 at this time. It will be transmitted directly to the bus controller 670 to obtain data corresponding to the physical address. Therefore, the device is compatible with two different data acquisition technologies.
  • the first technology is a data acquisition technology that needs to be processed by the service processing device 650.
  • the virtual address requested by the graphics processor 620 passes through the preset target address interval.
  • the business processing device 650 processes the external data, which is converted to data that the graphics processor 620 can recognize or use but the data content does not change.
  • Another technique is that without the participation of the service processing device 650, the virtual address requested by the graphics processor 620 is directly translated into a physical address and external data is obtained according to the physical address, at which time the external data is recognized or used by the graphics processor 620. The data does not need to be converted by data format or type.
  • the address filter of this embodiment may filter the input address, and output the address located in the first address interval to the service processing device 650, and will not be located in the first address interval, for example, in the second address interval.
  • the address is directly output to the bus controller 670, and the first address interval and the second address interval do not overlap.
  • the graphics processor 620 will eventually obtain its required data.
  • the data processing apparatus may not include the address filter 640, that is, the address filter 640 is not necessary, and the second memory management unit 630 and the service processing apparatus 650 may be directly coupled.
  • the above solution can save the system bandwidth occupied by the graphics processor 620 when acquiring data.
  • Other devices than the driver software in FIG. 6 may include a large number of circuits, such as at least one of a transistor, a logic gate circuit, or an analog circuit.
  • the driver software may be stored in a computer readable storage medium and read and executed by the graphics processor 620 to generate the service information in the previous embodiment, configure the first mapping table, or configure the first The operation of the second mapping table.
  • the computer readable storage medium can be the memory 215 of FIG.
  • the available medium for the memory may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a digital versatile disc (DVD)), or a semiconductor medium (eg, a solid state disk) , SSD)) and so on.
  • a magnetic medium eg, a floppy disk, a hard disk, a magnetic tape
  • an optical medium eg, a digital versatile disc (DVD)
  • DVD digital versatile disc
  • SSD solid state disk
  • the bus controller referred to in the previous embodiment is the core of the bus system for connecting the device and other devices, such as other components within the system chip 210 or components other than the system chip.
  • the bus system includes a bus and a bus controller.
  • the task of the bus controller is generally to manage the use of various types of buses, including the management of devices on the bus and the process management of the devices using the bus.
  • the bus controller is coupled to the bus in this embodiment and can control the bus to access an external memory for reading data from a memory external to the device based on a physical address control bus transmitted from a service processing device, address filter or other device. And feedback to the graphics processor. Therefore, the graphics processor can acquire and utilize data stored outside the data processing device via the bus controller by using virtual memory management technology.
  • the memory may be an external memory of the system chip or an on-chip memory or a temporary storage device such as a buffer.
  • the business processing device provides the data requested by the graphics processor to the graphics processor, the data transmission does not pass through the bus outside the device, nor does it need to be stored in other memories coupled to the bus, which can save system bandwidth and further save The storage space of the system.
  • the channel between the service processing device and the graphics processor for transmitting the data is an interface other than the bus, such as a dedicated circuit interface.
  • the embodiment of the present application is equivalent to embedding a service processing device module in the device including the graphics processor, so that data transmission between the service processing device and the graphics processor does not pass through the bus and the external memory, and can be flexibly implemented differently.
  • the conversion of data types or formats is easy for the graphics processor to recognize and use, and can effectively save bandwidth.
  • Coupled as used in this application is used to mean the intercommunication or interaction between different components, and may include direct connection or indirect connection through other components. At least one of the embodiments is used to represent one or more in a broad sense, that is, to express one or any of a plurality of corresponding options.

Abstract

Embodiments of the present invention relate to the technical field of data processing. Disclosed are a data processing method and apparatus. The data processing apparatus comprises: a graphics processing unit, a service processing device, and a first memory management unit. The graphics processing unit is used for requesting first data corresponding to a first virtual address; the service processing device is used for converting the first virtual address into a second virtual address and outputting the second virtual address to the first memory management unit; the first memory management unit is used for searching for a first physical address corresponding to the second virtual address according to a first mapping table; the service processing device is also used for obtaining second data stored at the first physical address in an external memory; the service processing device is further used for processing the second data to obtain the first data, and outputting the first data to the graphics processing unit without a bus and the external memory.

Description

数据处理方法及装置Data processing method and device
本申请要求于2018年04月13日提交中国国家知识产权局、申请号为201810330125.9、申请名称为“数据处理方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。The present application claims priority to Chinese Patent Application No. 201 810 301 312 5.9, filed on Apr. 13, 2018, the entire disclosure of which is incorporated herein by reference. .
技术领域Technical field
本发明涉及数据处理技术领域,尤其涉及一种数据处理方法、装置及计算机可读介质。The present invention relates to the field of data processing technologies, and in particular, to a data processing method, apparatus, and computer readable medium.
背景技术Background technique
在手机、电视等消费电子领域,支持4K视频播放的手机、4K电视逐渐普及,8K电视也逐渐走进人们的生活。随着视频分辨率的提升,对系统带宽的需求也越来越大,芯片设计人员普遍采用图像数据压缩技术来降低系统带宽的占用。In the consumer electronics fields such as mobile phones and televisions, mobile phones and 4K TVs that support 4K video playback are gradually becoming popular, and 8K TVs are gradually entering people's lives. As the resolution of video increases, the demand for system bandwidth is also increasing. Chip designers generally use image data compression technology to reduce the bandwidth of the system.
但是,在同一个芯片中,若两个需要直接传输数据的功能模块采用了不同的压缩技术,就会存在两者之间的兼容问题。一个比较典型的场景,比如全景视频播放,需要将解码后的视频数据发送给图形处理器(Graphics Processing Unit,GPU)进行渲染,然后输出到显示器进行显示。如果一个视频播放装置中采用的GPU以及解码器各自使用的压缩技术不同,例如,该GPU采用的是第一压缩技术,而该解码器采用的是第二压缩技术,第一压缩技术和第二压缩技术不同,则该解码器解码输出的数据就不能直接发送给GPU进行处理。也就是说,当GPU和解码器采用的压缩技术不同时,GPU不能识别或直接使用解码器输出的数据。当解码器和GPU由不同厂家提供时,这种问题会比较常见。可见,当GPU和某个功能模块不兼容时,GPU不能识别该功能模块输出的数据,这时需要将GPU不可识别或使用的数据转换为GPU可识别或使用的数据并输出至GPU。However, in the same chip, if two functional modules that need to directly transmit data use different compression technologies, there will be compatibility problems between the two. A typical scene, such as panoramic video playback, needs to send the decoded video data to a graphics processing unit (GPU) for rendering, and then output to the display for display. If the GPU and the decoder used in a video playback device respectively use different compression technologies, for example, the GPU adopts a first compression technology, and the decoder uses a second compression technology, a first compression technique, and a second. If the compression technique is different, the data decoded by the decoder cannot be directly sent to the GPU for processing. That is to say, when the compression technology used by the GPU and the decoder is different, the GPU cannot recognize or directly use the data output by the decoder. This problem is more common when the decoder and GPU are provided by different vendors. It can be seen that when the GPU and a certain functional module are incompatible, the GPU cannot recognize the data output by the function module, and the data that is not recognized or used by the GPU needs to be converted into data that the GPU can recognize or use and output to the GPU.
对于将GPU不可识别或使用的数据转换为GPU可识别或使用的数据并输出至GPU的问题。当前,采用的一种技术方案是通过一个独立的业务处理装置将GPU不可识别或使用的数据转换成GPU可识别或使用的数据并存储到内存,GPU从内存读取该可识别或使用的数据并进行处理。请参阅图1,图1为现有技术中一种将GPU不可识别或使用的数据转换成GPU可识别或使用的数据并输出至GPU的流程示意图。如图1所示,101表示GPU不可识别或使用的数据,102表示业务处理装置,103表示业务处理装置输出的GPU可识别或使用的数据,104表示GPU。其中,业务处理装置将GPU不可识别或使用的数据转换为GPU可识别或使用的数据,并存储到内存,GPU通过总线从内存读取可识别或使用的数据。在这个方案中,业务处理装置需要将输出的GPU可识别或使用的数据写入内存,GPU需要从内存读取可识别或使用的数据。可见,上述技术方案中,将GPU不可识别或使用的数据转换为GPU可识别或使用的数据并输出至GPU,需要占用很多系统带宽。A problem for converting data that is not identifiable or used by the GPU to data that the GPU can recognize or use and output to the GPU. Currently, a technical solution adopted is to convert data that is not identifiable or used by the GPU into data recognizable or used by the GPU through a separate service processing device and store the data in the memory, and the GPU reads the identifiable or used data from the memory. And process it. Please refer to FIG. 1. FIG. 1 is a schematic flowchart of converting data that is not recognized or used by a GPU into data that can be recognized or used by a GPU and output to a GPU. As shown in FIG. 1, 101 denotes data that the GPU does not recognize or use, 102 denotes a service processing device, 103 denotes data that the GPU can recognize or use, and 104 denotes a GPU. The service processing device converts data that is unrecognizable or used by the GPU into data that the GPU can recognize or use, and stores the data in the memory, and the GPU reads the identifiable or used data from the memory through the bus. In this scenario, the business processing device needs to write the data that the output GPU can recognize or use to the memory, and the GPU needs to read the identifiable or used data from the memory. It can be seen that, in the above technical solution, converting data that is not recognized or used by the GPU into data that can be recognized or used by the GPU and outputting to the GPU requires a lot of system bandwidth.
发明内容Summary of the invention
本申请提供了一种数据处理方法及装置,用于在将GPU不可识别或使用的数据转换为GPU可识别或使用的数据并输出至GPU的过程中节省系统带宽。The present application provides a data processing method and apparatus for conserving system bandwidth in converting data that is unrecognizable or used by a GPU into data that the GPU can recognize or use and output to the GPU.
第一方面本发明实施例提供了一种数据处理装置,包括:图形处理器、业务处理装置 以及第一内存管理单元(Memory Management Unit,MMU);所述图形处理器与所述第一内存管理单元分别与业务处理装置耦合;所述图形处理器,用于请求第一虚拟地址对应的第一数据,所述第一数据为所述业务处理装置处理后的数据且能够被所述图形处理器使用或识别;所述业务处理装置,用于将所述第一虚拟地址转换为第二虚拟地址并将所述第二虚拟地址输出至所述第一内存管理单元,所述第二虚拟地址对应所述业务处理装置处理前的第二数据;所述第一内存管理单元,用于根据第一映射表查找与所述第二虚拟地址对应的第一物理地址;所述业务处理装置,还用于获取在存储器内的所述第一物理地址存储的所述第二数据,所述第二数据不能够被所述图形处理器使用或识别,所述数据处理装置通过总线耦合至所述存储器;所述业务处理装置,还用于处理所述第二数据以得到所述第一数据,在没有所述总线或所述存储器中的一个或全部参与的情况下将所述第一数据输出至所述图形处理器。所述第二数据和所述第一数据是不同类型或格式的数据。The first aspect of the present invention provides a data processing apparatus, including: a graphics processor, a service processing device, and a first memory management unit (MMU); the graphics processor and the first memory management The unit is respectively coupled to the service processing device; the graphics processor is configured to request first data corresponding to the first virtual address, the first data is data processed by the service processing device and can be used by the graphics processor The service processing device is configured to convert the first virtual address into a second virtual address and output the second virtual address to the first memory management unit, where the second virtual address corresponds to And the first memory management unit is configured to search for a first physical address corresponding to the second virtual address according to the first mapping table; and the service processing device is further used by the service processing device. Acquiring the second data stored in the first physical address in the memory, the second data cannot be used or recognized by the graphics processor The data processing device is coupled to the memory via a bus; the service processing device is further configured to process the second data to obtain the first data, in the absence of the bus or one of the memories or The first data is output to the graphics processor in the case of full participation. The second data and the first data are data of different types or formats.
可选地,所述业务处理装置用于将第二数据转换为所述第一数据,以使得所述图形处理器能够使用所述第一数据。可选地,所述业务处理装置包括如下至少一个:解压缩单元、压缩单元、解密单元或加密单元。所述业务处理装置可以执行解压操作、压缩操作、解密操作或加密操作等中的至少一个。例如,该业务处理装置一个典型的示例是解压缩单元。本申请中,业务处理装置可实现多种数据处理操作,可应用于多个场景。Optionally, the service processing apparatus is configured to convert the second data into the first data to enable the graphics processor to use the first data. Optionally, the service processing apparatus includes at least one of: a decompression unit, a compression unit, a decryption unit, or an encryption unit. The business processing apparatus may perform at least one of a decompression operation, a compression operation, a decryption operation, or an encryption operation. For example, a typical example of the service processing device is a decompression unit. In the present application, the service processing device can implement various data processing operations and can be applied to multiple scenarios.
可选地,所述第一内存管理单元可以根据所述第一映射表将所述第二虚拟地址映射为所述第一物理地址。所述第一映射表包含至少一个虚拟地址和至少一个物理地址的对应关系。所述业务处理装置可以实现地址转换功能,即将所述第一虚拟地址转换为所述第二虚拟地址。所述第一映射表可以为所述图形处理器或其他处理器运行的驱动软件配置的。Optionally, the first memory management unit may map the second virtual address to the first physical address according to the first mapping table. The first mapping table includes a correspondence between at least one virtual address and at least one physical address. The service processing apparatus may implement an address translation function to convert the first virtual address into the second virtual address. The first mapping table may be configured for driver software running by the graphics processor or other processor.
本申请中,在数据处理装置未存储有图形处理器所请求的第一数据的情况下,业务处理装置获取第二数据,处理该第二数据得到该第一数据,并输出至该图形处理器;可以将GPU不可识别或使用的数据转换为GPU可识别或使用的数据并输出至该图形处理器,并节省系统带宽。In the present application, in a case where the data processing device does not store the first data requested by the graphics processor, the service processing device acquires the second data, processes the second data to obtain the first data, and outputs the first data to the graphics processor. Data that is unrecognizable or used by the GPU can be converted to and recognized by the GPU and output to the graphics processor, saving system bandwidth.
可选地,业务处理装置与图形处理器之间传输第二数据的通道是除了总线之外的其他接口。可选地,所述装置是集成电路。Optionally, the channel for transmitting the second data between the service processing device and the graphics processor is an interface other than the bus. Optionally, the device is an integrated circuit.
在一个可选的实现方式中,提供了一种虚拟地址转换方法,具体如下:所述业务处理装置,还用于获取业务信息;所述业务信息包含将所述第一虚拟地址转换为所述第二虚拟地址所需的信息;所述业务处理装置,具体用于根据所述业务信息将所述第一虚拟地址转换为所述第二虚拟地址。In an optional implementation, a virtual address translation method is provided, where the service processing device is further configured to obtain service information, where the service information includes converting the first virtual address to the Information required by the second virtual address; the service processing device is specifically configured to convert the first virtual address into the second virtual address according to the service information.
可选地,所述第一虚拟地址对应所述第一数据,所述第二虚拟地址对应所述第二数据。所述业务处理装置处理所述第二数据可以得到所述第一数据。所述业务处理装置将所述第一虚拟地址转换为所述第二虚拟地址可以理解为所述业务处理装置根据所需输出至所述图形处理器的所述第一数据对应的虚拟地址,确定得到所述第一数据所需的所述第二数据对应的虚拟地址。所述第一数据为所述业务处理装置的待输出数据,即待输出至所述图形处理器的数据。Optionally, the first virtual address corresponds to the first data, and the second virtual address corresponds to the second data. The service processing device processes the second data to obtain the first data. Converting, by the service processing device, the first virtual address to the second virtual address may be understood by the service processing device determining, according to a virtual address corresponding to the first data that is required to be output to the graphics processor, Obtaining a virtual address corresponding to the second data required by the first data. The first data is data to be outputted by the service processing device, that is, data to be output to the graphics processor.
本申请中,业务处理装置可以将待输出数据对应的虚拟地址转换为得到该待输出数据所需的数据对应的虚拟地址,以便于该业务处理装置得到该待输出数据,实现简单。In this application, the service processing device may convert the virtual address corresponding to the data to be output into a virtual address corresponding to the data required to obtain the data to be output, so that the service processing device obtains the data to be output, which is simple to implement.
在一个可选的实现方式中,所述数据处理装置还包括第二内存管理单元,耦合在所述图形处理器和所述业务处理装置之间;所述图形处理器,具体用于向所述第二内存管理单元发送第一数据获取请求,所述第一数据获取请求包括第三虚拟地址,所述第三虚拟地址用于指示所述第一虚拟地址;所述第二内存管理单元,用于根据第二映射表查找与所述第三虚拟地址对应的所述第一虚拟地址并进一步向所述业务处理装置请求所述第一虚拟地址对应的所述第一数据。In an optional implementation, the data processing apparatus further includes a second memory management unit coupled between the graphics processor and the service processing device; the graphics processor is specifically configured to The second memory management unit sends a first data acquisition request, where the first data acquisition request includes a third virtual address, the third virtual address is used to indicate the first virtual address, and the second memory management unit is used by And searching for the first virtual address corresponding to the third virtual address according to the second mapping table, and further requesting, by the service processing device, the first data corresponding to the first virtual address.
可选地,所述第二内存管理单元分别与所述图形处理器和所述业务处理装置相耦合。所述第二映射表可以为所述图形处理器或其他处理器运行的驱动软件配置的。所述第二映射表包含至少一个虚拟地址到虚拟地址的映射关系。所述第二映射表还可以包含至少一个虚拟地址与至少一个物理地址的对应关系。所述第一虚拟地址和所述第三虚拟地址相同。Optionally, the second memory management unit is coupled to the graphics processor and the service processing device, respectively. The second mapping table may be configured for driver software running by the graphics processor or other processor. The second mapping table includes a mapping relationship of at least one virtual address to a virtual address. The second mapping table may further include a correspondence between at least one virtual address and at least one physical address. The first virtual address and the third virtual address are the same.
本申请中,图形处理器通过第二内存管理单元向业务处理装置请求数据,以便于得到业务处理装置输出的数据,实现简单、兼容性强。In the present application, the graphics processor requests data from the service processing device through the second memory management unit, so as to obtain data output by the service processing device, which is simple in implementation and strong in compatibility.
在一个可选的实现方式中,所述图形处理器通过运行驱动软件执行以下至少一个操作:生成所述业务信息、配置所述第一映射表或配置所述第二映射表。In an optional implementation, the graphics processor performs at least one of: generating the service information, configuring the first mapping table, or configuring the second mapping table by running driver software.
可选地,所述图形处理器通过运行驱动软件执行生成所述业务信息、配置所述第一映射表或配置所述第二映射表等操作,以便于所述图形处理器获取到所需的数据。所述驱动软件生成的所述业务信息与所述图形处理器请求的数据相对应。Optionally, the graphics processor performs operations such as generating the service information, configuring the first mapping table, or configuring the second mapping table by running driver software, so that the graphics processor obtains the required data. The service information generated by the driver software corresponds to data requested by the graphics processor.
本申请中,图形处理器通过运行驱动软件生成业务信息、配置第一映射表或配置第二映射表等,以便于满足图形处理器发出的各种数据获取请求,灵活度高,可以满足不同应用场景的需求。In the present application, the graphics processor generates service information, configures the first mapping table, or configures the second mapping table by running the driver software, so as to satisfy various data acquisition requests sent by the graphics processor, and has high flexibility and can meet different applications. The needs of the scene.
在一个可选的实现方式中,所述业务处理装置,具体用于接收所述第一内存管理单元输入的所述第一物理地址,将所述第一物理地址输出至总线控制器,并接收所述总线控制器输出的所述第二数据,所述总线控制器通过所述总线耦合至所述存储器。In an optional implementation, the service processing device is specifically configured to receive the first physical address input by the first memory management unit, output the first physical address to a bus controller, and receive The second data output by the bus controller, the bus controller being coupled to the memory via the bus.
在一个可选的实现方式中,所述数据处理装置还包括地址过滤器,耦合在所述第二内存管理单元和所述业务处理装置之间;所述第二内存管理单元,具体用于向所述地址过滤器发送所述第一虚拟地址;所述地址过滤器,用于接收所述第一虚拟地址,在所述第一虚拟地址处于目标地址区间的情况下,将所述第一虚拟地址输出至所述业务处理装置。In an optional implementation, the data processing apparatus further includes an address filter coupled between the second memory management unit and the service processing device, and the second memory management unit is specifically configured to The address filter sends the first virtual address; the address filter is configured to receive the first virtual address, and if the first virtual address is in a target address interval, the first virtual The address is output to the service processing device.
可选地,所述地址过滤器将处于所述目标地址区间的地址输出至所述业务处理装置,未处于所述目标地址区间的地址不被向所述业务处理装置输出。Optionally, the address filter outputs an address in the target address interval to the service processing device, and an address not in the target address interval is not output to the service processing device.
本申请中,地址过滤器将处于目标地址区间的地址输出到业务处理装置,可以减轻业务处理装置的处理负担。In the present application, the address filter outputs the address in the target address range to the service processing device, which can reduce the processing load of the service processing device.
在一个可选的实现方式中,所述图形处理器,还用于向所述第二内存管理单元发送第二数据获取请求,所述第二数据获取请求包括第四虚拟地址;所述第二内存管理单元,还用于根据所述第二映射表查找与所述第四虚拟地址对应的第二物理地址并向所述地址过滤器发送所述第二物理地址;所述地址过滤器,还用于接收所述第二物理地址,在所述第二物理地址未处于所述目标地址区间的情况下,通过总线控制器获取所述第二物理地址存储的第三数据,并输出所述第三数据至所述图形处理器。In an optional implementation, the graphics processor is further configured to send a second data acquisition request to the second memory management unit, where the second data acquisition request includes a fourth virtual address; a memory management unit, configured to: search a second physical address corresponding to the fourth virtual address according to the second mapping table, and send the second physical address to the address filter; the address filter, further And receiving the second physical address, where the second physical address is not in the target address interval, acquiring third data stored in the second physical address by using a bus controller, and outputting the first Three data to the graphics processor.
本申请中,地址过滤器通过总线控制器获取未处于目标地址区间的地址存储的数据, 并输出至图形处理器;可以快速地将图形处理器请求的数据输出至图形处理器。In the present application, the address filter acquires data stored at an address that is not in the target address range through the bus controller, and outputs the data to the graphics processor; the data requested by the graphics processor can be quickly output to the graphics processor.
第二方面,本申请提供了一种数据处理方法,应用于数据处理装置,所述数据处理装置包括依次耦合的图形处理器、业务处理装置以及第一内存管理单元,该方法包括:所述图形处理器请求第一虚拟地址对应的第一数据,所述第一数据为所述业务处理装置处理后的数据且能够被所述图形处理器使用或识别;所述业务处理装置将所述第一虚拟地址转换为第二虚拟地址并将所述第二虚拟地址输出至所述第一内存管理单元,所述第二虚拟地址对应所述业务处理装置处理前的第二数据;所述第一内存管理单元根据第一映射表查找与所述第二虚拟地址对应的第一物理地址;所述业务处理装置获取在存储器内的所述第一物理地址存储的所述第二数据,所述第二数据不能够被所述图形处理器使用或识别,所述数据处理装置通过总线耦合至所述存储器;所述业务处理装置处理所述第二数据以得到所述第一数据,在没有所述总线或所述存储器中的一个或全部参与的情况下将所述第一数据输出至所述图形处理器。所述第二数据和所述第一数据是不同类型或格式的数据。In a second aspect, the present application provides a data processing method for a data processing apparatus, the data processing apparatus comprising a graphics processor, a service processing apparatus, and a first memory management unit coupled in sequence, the method comprising: the graphics The processor requests first data corresponding to the first virtual address, the first data is data processed by the service processing device and can be used or recognized by the graphics processor; the service processing device will be the first Converting the virtual address to the second virtual address and outputting the second virtual address to the first memory management unit, where the second virtual address corresponds to the second data before the processing by the service processing device; the first memory The management unit searches for a first physical address corresponding to the second virtual address according to the first mapping table; the service processing device acquires the second data stored in the first physical address in the memory, the second Data cannot be used or identified by the graphics processor, the data processing device being coupled to the memory via a bus; Second means for processing said first data to obtain the data, in a case where there is no bus or the memory or all of the participating the output of the first data to the graphics processor. The second data and the first data are data of different types or formats.
本申请中,在数据处理装置未存储有图形处理器所请求的第一数据的情况下,业务处理装置获取第二数据,处理该第二数据得到该第一数据,并输出至该图形处理器;能够将GPU不可识别或使用的数据转换为GPU可识别或使用的数据,并节省系统带宽。In the present application, in a case where the data processing device does not store the first data requested by the graphics processor, the service processing device acquires the second data, processes the second data to obtain the first data, and outputs the first data to the graphics processor. Ability to convert data that is unrecognizable or used by the GPU to data that the GPU can recognize or use, and save system bandwidth.
在一个可选的实现方式中,所述业务处理装置将所述第一虚拟地址转换为第二虚拟地址包括:所述业务处理装置获取业务信息;所述业务信息包含将所述第一虚拟地址转换为所述第二虚拟地址所需的信息;所述业务处理装置根据所述业务信息将所述第一虚拟地址转换为所述第二虚拟地址。In an optional implementation manner, the converting, by the service processing device, the first virtual address to the second virtual address includes: the service processing device acquiring service information; the service information including the first virtual address Converting information required for the second virtual address; the service processing device converting the first virtual address to the second virtual address according to the service information.
本申请中,业务处理装置可以将待输出数据对应的虚拟地址转换为得到该待输出数据所需的数据对应的虚拟地址,以便于该业务处理装置得到该待输出数据,实现简单。In this application, the service processing device may convert the virtual address corresponding to the data to be output into a virtual address corresponding to the data required to obtain the data to be output, so that the service processing device obtains the data to be output, which is simple to implement.
在一个可选的实现方式中,所述数据处理装置还包括与所述图形处理器相耦合的第二内存管理单元;所述图形处理器请求第一虚拟地址对应的第一数据包括:所述图形处理器向所述第二内存管理单元发送第一数据获取请求,所述第一数据获取请求包括第三虚拟地址,所述第三虚拟地址用于指示所述第一虚拟地址;所述第二内存管理单元根据第二映射表查找与所述第三虚拟地址对应的所述第一虚拟地址并进一步向所述业务处理装置请求所述第一虚拟地址对应的所述第一数据。In an optional implementation, the data processing apparatus further includes a second memory management unit coupled to the graphics processor; the first data corresponding to the first virtual address by the graphics processor includes: The graphics processor sends a first data acquisition request to the second memory management unit, the first data acquisition request includes a third virtual address, and the third virtual address is used to indicate the first virtual address; The second memory management unit searches for the first virtual address corresponding to the third virtual address according to the second mapping table, and further requests the first data corresponding to the first virtual address to the service processing device.
本申请中,图形处理器通过第二内存管理单元向业务处理装置请求数据,以便于得到业务处理装置输出的数据,实现简单、兼容性强。In the present application, the graphics processor requests data from the service processing device through the second memory management unit, so as to obtain data output by the service processing device, which is simple in implementation and strong in compatibility.
在一个可选的实现方式中,所述方法还包括执行以下至少一个操作:生成所述业务信息、配置所述第一映射表或配置所述第二映射表。本申请中,图形处理器通过运行驱动软件生成业务信息、配置第一映射表或配置第二映射表等,以便于满足图形处理器发出的各种数据获取请求,灵活度高。In an optional implementation manner, the method further includes performing at least one of: generating the service information, configuring the first mapping table, or configuring the second mapping table. In the present application, the graphics processor generates service information by running the driver software, configures the first mapping table, or configures the second mapping table, etc., so as to satisfy various data acquisition requests sent by the graphics processor, and the flexibility is high.
在一个可选的实现方式中,所述业务处理装置获取在存储器内的所述第一物理地址存储的所述第二数据包括:所述业务处理装置接收所述第一内存管理单元输入的所述第一物理地址;将所述第一物理地址输出至总线控制器,并接收所述总线控制器输出的所述第二数据,所述总线控制器通过所述总线耦合至所述存储器。In an optional implementation manner, the acquiring, by the service processing device, the second data stored in the first physical address in the memory comprises: receiving, by the service processing device, the input by the first memory management unit Decoding a first physical address; outputting the first physical address to a bus controller and receiving the second data output by the bus controller, the bus controller being coupled to the memory via the bus.
在一个可选的实现方式中,所述数据处理装置还包括分别与所述第二内存管理单元和 所述业务处理装置耦合的地址过滤器;所述业务处理装置将所述第二虚拟地址转换为第三虚拟地址之前,所述方法还包括:所述第二内存管理单元向所述地址过滤器发送所述第一虚拟地址;所述地址过滤器接收所述第二内存管理单元输入的所述第一虚拟地址;在所述第一虚拟地址处于目标地址区间的情况下,将所述第一虚拟地址输出至所述业务处理装置。In an optional implementation, the data processing apparatus further includes an address filter coupled to the second memory management unit and the service processing device, respectively; the service processing device converts the second virtual address Before the third virtual address, the method further includes: the second memory management unit sends the first virtual address to the address filter; and the address filter receives the input by the second memory management unit Describe a first virtual address; if the first virtual address is in a target address interval, output the first virtual address to the service processing device.
本申请中,地址过滤器将处于目标地址区间的地址输出到业务处理装置,可以减轻业务处理装置的处理负担。In the present application, the address filter outputs the address in the target address range to the service processing device, which can reduce the processing load of the service processing device.
在一个可选的实现方式中,所述方法还包括:所述图形处理器向所述第二内存管理单元发送第二数据获取请求,所述第二数据获取请求包括第四虚拟地址;所述第二内存管理单元根据所述第二映射表查找与所述第四虚拟地址对应的第二物理地址并向所述地址过滤器发送所述第二物理地址;所述地址过滤器接收所述第二物理地址,在所述第二物理地址未处于所述目标地址区间的情况下,通过总线控制器获取所述第二物理地址存储的第三数据,并输出所述第三数据至所述图形处理器。In an optional implementation manner, the method further includes: the graphics processor sending a second data acquisition request to the second memory management unit, where the second data acquisition request includes a fourth virtual address; The second memory management unit searches for the second physical address corresponding to the fourth virtual address according to the second mapping table and sends the second physical address to the address filter; the address filter receives the first a second physical address, where the second physical address is not in the target address interval, acquiring third data stored in the second physical address by using a bus controller, and outputting the third data to the graphic processor.
本申请中,通过总线控制器获取未处于目标地址区间的地址存储的数据,并输出至图形处理器;可以快速地将图形处理器请求的数据输出至图形处理器。In the present application, data stored at an address that is not in the target address range is acquired by the bus controller and output to the graphics processor; the data requested by the graphics processor can be quickly output to the graphics processor.
在一个可选的实现方式中,所述业务处理装置包括如下至少一个:解压缩单元、压缩单元、解密单元或加密单元。In an optional implementation manner, the service processing apparatus includes at least one of: a decompression unit, a compression unit, a decryption unit, or an encryption unit.
本申请中,业务处理装置可实现多种数据处理操作,可应用于多个场景。In the present application, the service processing device can implement various data processing operations and can be applied to multiple scenarios.
第三方面,本申请提供了一种计算机可读存储介质,所述计算机存储介质存储有计算机程序,所述计算机程序包括程序指令,所述程序指令当被图形处理器执行时所述图形处理器执行上述第一方面和上述第二方面中生成所述业务信息、配置所述第一映射表或配置所述第二映射表的操作。In a third aspect, the present application provides a computer readable storage medium storing a computer program, the computer program comprising program instructions, the program instructions being executed by a graphics processor The operations of generating the service information, configuring the first mapping table, or configuring the second mapping table in the first aspect and the second aspect described above are performed.
附图说明DRAWINGS
为了更清楚地说明本发明实施例中的技术方案,下面将对本发明实施例或背景技术中所需要使用的附图进行说明。In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings to be used in the embodiments of the present invention or the background art will be described below.
图1为现有技术中一种将GPU不可识别或使用的数据转换成GPU可识别或使用的数据并输出至GPU的流程示意图;FIG. 1 is a schematic flow chart of converting data that is not identifiable or used by a GPU into data that can be recognized or used by a GPU and outputting to a GPU;
图2为本申请提供的一种终端的结构示意图;2 is a schematic structural diagram of a terminal provided by the present application;
图3为本申请提供的一种将GPU不可识别或使用的数据转换成GPU可识别或使用的数据并输出至GPU的流程示意图;FIG. 3 is a schematic flowchart of converting data that is unrecognizable or used by a GPU into data that can be recognized or used by a GPU and outputting the same to the GPU;
图4为本申请提供的一种数据处理装置结构示意图;4 is a schematic structural diagram of a data processing apparatus provided by the present application;
图5为本申请提供的原始数据和压缩数据的结构示意图;FIG. 5 is a schematic structural diagram of original data and compressed data provided by the present application; FIG.
图6为本申请提供的另一种数据处理装置结构示意图。FIG. 6 is a schematic structural diagram of another data processing apparatus provided by the present application.
具体实施方式detailed description
采用背景技术介绍的技术方案,在将GPU不可识别或使用的数据转换为GPU可识别或使用的数据并输出至GPU的过程中需要占用大量系统带宽。因此,本申请提供了一种数据处理方法及装置,用于节省系统带宽。本申请提供的数据处理装置及方法可以应用在台 式电脑、笔记本电脑、电视机、手机、平板电脑、个人数字助理、可穿戴设备、游戏机、或摄像机等包含GPU的装置中。可选地,该系统带宽可包括总线带宽或存储器的读写带宽的一个或全部。With the technical solution introduced by the background technology, a large amount of system bandwidth is required in converting data that is unrecognizable or used by the GPU into data that the GPU can recognize or use and output to the GPU. Therefore, the present application provides a data processing method and apparatus for saving system bandwidth. The data processing apparatus and method provided by the present application can be applied to a GPU-containing device such as a desktop computer, a notebook computer, a television, a mobile phone, a tablet computer, a personal digital assistant, a wearable device, a game machine, or a video camera. Alternatively, the system bandwidth can include one or all of bus bandwidth or read and write bandwidth of the memory.
图2示出了本申请一个实施例的终端的结构示意图。如图2所示,终端200可包括:系统芯片210、存储器215(一个或多个计算机可读存储介质)、射频(RF)模块216、外围系统217。这些部件可在一个或多个通信总线214上通信。FIG. 2 is a schematic structural diagram of a terminal according to an embodiment of the present application. As shown in FIG. 2, the terminal 200 can include a system chip 210, a memory 215 (one or more computer readable storage media), a radio frequency (RF) module 216, and a peripheral system 217. These components can communicate over one or more communication buses 214.
外围系统217主要用于实现终端200和用户/外部环境之间的交互功能,主要包括终端200的输入输出装置。具体实现中,外围系统217可包括:触摸屏控制器218、摄像头控制器219、音频控制器220以及传感器管理模块221。其中,各个控制器可与各自对应的外围设备(如触摸屏223、摄像头224、音频电路225以及传感器226)耦合。需要说明的,外围系统217还可以包括其他I/O外设。The peripheral system 217 is mainly used to implement the interaction function between the terminal 200 and the user/external environment, and mainly includes the input and output devices of the terminal 200. In a specific implementation, the peripheral system 217 can include: a touch screen controller 218, a camera controller 219, an audio controller 220, and a sensor management module 221. Each controller may be coupled to a respective peripheral device such as touch screen 223, camera 224, audio circuit 225, and sensor 226. It should be noted that the peripheral system 217 may also include other I/O peripherals.
系统芯片210可包括:中央处理器211、图形处理器227、时钟模块222以及电源管理模块213。中央处理器211和图形处理器227既可以集成在一个集成电路中,也可以是各自分离的器件。图形处理器227可以被配置有一个或多个内存管理单元,并进一步与业务处理装置集成在一起,该业务处理装置可以执行读写、解压、解密、压缩以及加密等操作,以便将获取的外部数据转换为图形处理器227可识别或使用的数据。集成于系统芯片210中的时钟模块222主要用于为中央处理器211产生数据传输和时序控制所需要的时钟。集成于系统芯片210中的电源管理模块213主要用于为中央处理器211、射频模块216以及外围系统提供稳定的、高精确度的电压。系统芯片210可进一步包括总线控制器(图2未示出),用于管理通信总线214。本实施例中涉及的总线214可以包括各种类型的总线,如串行总线、并行总线、内部集成电路(Inter-Integrated Circuit,I2C)总线或外围元件互联高速(peripheral component interconnect express,PCIe)总线等,用于耦合系统中不同的部件或模块。本实施例中系统芯片210仅是举例,其内部多个部件或功能可以由多个芯片或其他分离部件代替。The system chip 210 may include a central processing unit 211, a graphics processor 227, a clock module 222, and a power management module 213. The central processing unit 211 and the graphics processing unit 227 can be integrated into one integrated circuit or separate devices. The graphics processor 227 can be configured with one or more memory management units and further integrated with the business processing device, which can perform operations such as reading, writing, decompressing, decrypting, compressing, and encrypting so that the acquired external The data is converted to data that the graphics processor 227 can recognize or use. The clock module 222 integrated in the system chip 210 is mainly used to generate a clock required for data transmission and timing control for the central processing unit 211. The power management module 213 integrated in the system chip 210 is mainly used to provide a stable, high-accuracy voltage for the central processing unit 211, the radio frequency module 216, and the peripheral system. The system chip 210 can further include a bus controller (not shown in FIG. 2) for managing the communication bus 214. The bus 214 involved in this embodiment may include various types of buses, such as a serial bus, a parallel bus, an Inter-Integrated Circuit (I2C) bus, or a peripheral component interconnect express (PCIe) bus. Etc., used to couple different components or modules in the system. The system chip 210 in this embodiment is merely an example, and various internal components or functions may be replaced by a plurality of chips or other separate components.
射频(RF)模块216用于接收和发送射频信号,主要集成了终端200的接收器和发射器。射频(RF)模块216通过射频信号与通信网络和其他通信设备通信。具体实现中,射频(RF)模块216可包括但不限于:天线系统、RF收发器、一个或多个放大器、调谐器、一个或多个振荡器、数字信号处理器、CODEC芯片、SIM卡和存储介质等。在一些实施例中,可在单独的芯片上实现射频(RF)模块216。A radio frequency (RF) module 216 is used to receive and transmit radio frequency signals, primarily integrating the receiver and transmitter of terminal 200. A radio frequency (RF) module 216 communicates with the communication network and other communication devices via radio frequency signals. In a specific implementation, the radio frequency (RF) module 216 can include, but is not limited to: an antenna system, an RF transceiver, one or more amplifiers, a tuner, one or more oscillators, a digital signal processor, a CODEC chip, a SIM card, and Storage media, etc. In some embodiments, a radio frequency (RF) module 216 can be implemented on a separate chip.
存储器215与中央处理器211耦合,用于存储各种软件程序和/或多组指令。具体实现中,存储器215可包括高速随机存取的存储器,并且也可包括非易失性存储器,例如一个或多个磁盘存储设备、闪存设备或其他非易失性固态存储设备。存储器215可以存储操作系统(下述简称系统),例如ANDROID,IOS,WINDOWS,或者LINUX等嵌入式操作系统。存储器215还可以存储网络通信程序,该网络通信程序可用于与一个或多个附加设备,一个或多个终端设备,一个或多个网络设备进行通信。存储器215还可以存储用户接口程序,该用户接口程序可以通过图形化的操作界面将应用程序的内容形象逼真的显示出来,并通过菜单、对话框以及按键等输入控件接收用户对应用程序的控制操作。 Memory 215 is coupled to central processor 211 for storing various software programs and/or sets of instructions. In particular implementations, memory 215 can include high speed random access memory, and can also include non-volatile memory, such as one or more magnetic disk storage devices, flash memory devices, or other non-volatile solid state storage devices. The memory 215 can store an operating system (hereinafter referred to as a system) such as an embedded operating system such as ANDROID, IOS, WINDOWS, or LINUX. The memory 215 can also store a network communication program that can be used to communicate with one or more additional devices, one or more terminal devices, one or more network devices. The memory 215 can also store a user interface program, which can realistically display the content of the application through a graphical operation interface, and receive user control operations on the application through input controls such as menus, dialog boxes, and keys. .
存储器215还可以存储一个或多个应用程序。如图2所示,这些应用程序可包括:社 交应用程序(例如Facebook),图像管理应用程序(例如相册),地图类应用程序(例如谷歌地图),浏览器(例如Safari,Google Chrome)等等。The memory 215 can also store one or more applications. As shown in FIG. 2, these applications may include: social applications (such as Facebook), image management applications (such as photo albums), map applications (such as Google Maps), browsers (such as Safari, Google Chrome), etc. .
本申请中,中央处理器211可用于读取和执行计算机可读指令。具体的,中央处理器211可用于调用存储于存储器215中的程序,并执行该程序包含的指令。图形处理器227,可用于进行各种绘制计算机图形所需的运算,包括顶点设置、光影、像素操作等。In the present application, central processor 211 can be used to read and execute computer readable instructions. Specifically, the central processing unit 211 can be used to call a program stored in the memory 215 and execute the instructions contained in the program. The graphics processor 227 can be used to perform various operations required to draw computer graphics, including vertex settings, lighting, pixel operations, and the like.
应当理解,终端200仅为本发明实施例提供的一个例子,并且,终端200可具有比示出的部件更多或更少的部件,可以组合两个或更多个部件,或者可具有部件的不同配置实现。It should be understood that the terminal 200 is only an example provided by an embodiment of the present invention, and that the terminal 200 may have more or less components than the illustrated components, may combine two or more components, or may have components. Different configurations are implemented.
请参阅图3,图3为本申请提供的一种将GPU不可识别或使用的数据转换成GPU可识别或使用的数据的流程示意图,即将一个类型或格式的数据转换为另一个类型或格式但不改变数据内容。如图3所示,301表示GPU不可识别或使用的数据,302表示与业务处理装置集成的GPU,303表示GPU输出的数据。该业务处理装置可以将该GPU不可识别或使用的数据转换为该GPU可识别或使用的数据而不改变数据内容,并输出至该GPU。由于该业务处理装置与该GPU集成在一起,该业务处理装置向该GPU传输数据不需要经过总线,且相对于现有技术可以省掉读写内存的操作,从而到达节省系统带宽的目标。由于所述业务处理装置可以将得到的所述数据直接传输至所述图形处理器,不需要将所述数据存储到外部存储器再由所述图形处理器从所述存储器读取,可以减少系统的内存消耗以及内存读写消耗的带宽。Please refer to FIG. 3. FIG. 3 is a schematic flowchart of converting data that is unrecognizable or used by a GPU into data that can be recognized or used by a GPU, that is, converting data of one type or format into another type or format. Does not change the data content. As shown in FIG. 3, 301 represents data that the GPU does not recognize or use, 302 represents a GPU integrated with the service processing device, and 303 represents data output by the GPU. The business processing device can convert data that is unrecognizable or used by the GPU into data that the GPU can recognize or use without changing the data content and output to the GPU. Since the service processing device is integrated with the GPU, the service processing device does not need to go through the bus to transmit data to the GPU, and the operation of reading and writing the memory can be omitted compared with the prior art, thereby achieving the goal of saving system bandwidth. Since the service processing device can directly transmit the obtained data to the graphics processor, the data need not be stored in an external memory and then read by the graphics processor from the memory, which can reduce the system. Memory consumption and bandwidth consumed by memory reads and writes.
在本实施例中图形处理器,又称显示核心、视觉处理器、显示芯片,是一种专门在个人电脑、工作站、游戏机和一些移动设备(如平板电脑、智能手机等)上进行图像运算工作的处理器或微处理器。本实施例涉及的数据处理装置可以包括用于实现数据转换的硬件加速器、逻辑电路、或专用硬件中的一个或多个。In this embodiment, the graphics processor, also known as the display core, the visual processor, and the display chip, is an image computing operation specially performed on a personal computer, a workstation, a game machine, and some mobile devices (such as a tablet computer or a smart phone). The processor or microprocessor that is working. The data processing apparatus according to this embodiment may include one or more of a hardware accelerator, a logic circuit, or dedicated hardware for implementing data conversion.
图4为本申请提供的一种数据处理装置的结构示意图,该装置可位于系统芯片210中,例如是系统芯片210内部的一部分集成电路。可选地,该装置也可以是系统芯片210本身,亦或是图2中的终端200。对于数据处理装置的具体形态本实施例不做具体限定。图4中的数据处理装置可包括:图形处理器410、业务处理装置420、第一内存管理单元430以及总线控制器440。业务处理装置420分别和图形处理器410、第一内存管理单元430以及总线控制器440耦合。其中,所述图形处理器410和所述业务处理装置420集成在一起。如图4所示,本申请中的数据处理装置可实现如下操作:401、图形处理器410或其他处理器运行的驱动软件为第一内存管理单元430配置第一映射表。所述第一映射表包含至少一个虚拟地址和至少一个物理地址的对应关系。所述其他处理器可以是中央处理器单元(CPU)或其他类型的可执行驱动软件的处理器设备。402、所述图形处理器410向业务处理装置420请求第一虚拟地址对应的第一数据。所述第一数据为所述业务处理装置420处理后的数据且能够被所述图形处理器420使用或识别。图4中的VA表示第一虚拟地址。403、所述业务处理装置420将所述第一虚拟地址转换为第二虚拟地址并将所述第二虚拟地址输出至第一内存管理单元430。所述第二虚拟地址对应所述业务处理装置420处理前的第二数据。该第二数据可以存储在数据处理装置外部的存储器,可以是如图2所示存储器215,还可以是系统芯片210中的缓存器(buffer)或片上存储器等。所述数据处理装置通过总线耦合至所述存储器。图4中的VA’表示第二虚拟地址。404、所述第一内存管理单元430根据第一映射表查找与所述第二虚拟 地址对应的第一物理地址,并将所述第一物理地址输出至业务处理装置420。图4中的PA表示第一物理地址。405、所述业务处理装置420将所述第一物理地址输出至总线控制器440。406、所述业务处理装置420接收来自所述总线控制器440的第二数据,所述第二数据与所述第一数据是属于不同类型或格式,因此该第二数据不能够直接被所述图形处理器420使用或识别。407、所述业务处理装置420处理所述第二数据以得到第一数据,在没有所述总线或所述存储器中的一个或全部参与的情况下将所述第一数据输出至所述图形处理器410,以使得所述图形处理器410能够识别和使用所述第一数据。例如,业务处理装置420向所述图形处理器410提供的第一数据并不经过所述总线和所述存储器。在此种情况下,所述总线和所述存储器并没有参与到第一数据的传输中,使得所述总线带宽被节省,且所述存储器的存储空间和读写存储器的带宽也被节省,从而节省了总的系统带宽。可选地,所述业务处理装置420向所述图形处理器410传输第一数据的通道是除了总线之外的其他接口,如专用的电路接口。FIG. 4 is a schematic structural diagram of a data processing apparatus provided in the present application. The apparatus may be located in the system chip 210, for example, a part of an integrated circuit inside the system chip 210. Alternatively, the device may also be the system chip 210 itself or the terminal 200 in FIG. The specific embodiment of the data processing device is not specifically limited in this embodiment. The data processing apparatus of FIG. 4 may include a graphics processor 410, a service processing apparatus 420, a first memory management unit 430, and a bus controller 440. The business processing device 420 is coupled to the graphics processor 410, the first memory management unit 430, and the bus controller 440, respectively. The graphics processor 410 and the service processing device 420 are integrated. As shown in FIG. 4, the data processing apparatus in the present application can implement the following operations: 401. The graphics processor 410 or other driver software running by the processor configures the first mapping table for the first memory management unit 430. The first mapping table includes a correspondence between at least one virtual address and at least one physical address. The other processor may be a central processing unit (CPU) or other type of processor device that can execute the driver software. 402. The graphics processor 410 requests the service processing device 420 for the first data corresponding to the first virtual address. The first data is data processed by the business processing device 420 and can be used or recognized by the graphics processor 420. VA in Fig. 4 represents the first virtual address. 403. The service processing device 420 converts the first virtual address into a second virtual address and outputs the second virtual address to the first memory management unit 430. The second virtual address corresponds to the second data before the processing by the service processing device 420. The second data may be stored in a memory external to the data processing device, may be the memory 215 as shown in FIG. 2, or may be a buffer or an on-chip memory in the system chip 210. The data processing device is coupled to the memory via a bus. VA' in Fig. 4 denotes a second virtual address. 404. The first memory management unit 430 searches for a first physical address corresponding to the second virtual address according to the first mapping table, and outputs the first physical address to the service processing device 420. The PA in Fig. 4 represents the first physical address. 405. The service processing device 420 outputs the first physical address to the bus controller 440. 406, the service processing device 420 receives second data from the bus controller 440, the second data and The first data is of a different type or format, so the second data cannot be directly used or recognized by the graphics processor 420. 407. The service processing device 420 processes the second data to obtain first data, and outputs the first data to the graphics processing without one or all of the bus or the memory participating. 410, to enable the graphics processor 410 to identify and use the first data. For example, the first data provided by the business processing device 420 to the graphics processor 410 does not pass through the bus and the memory. In this case, the bus and the memory are not involved in the transmission of the first data, so that the bus bandwidth is saved, and the storage space of the memory and the bandwidth of the read-write memory are also saved. Saves on total system bandwidth. Optionally, the channel through which the service processing device 420 transmits the first data to the graphics processor 410 is an interface other than a bus, such as a dedicated circuit interface.
本发明实施中所述存储器中地址有虚拟地址和物理地址之分,处理器或其他器件通过地址来访问存储器中的数据。例如,在存储器里以字节为单位存储信息,为了正确地存放或取得信息,每一个字节单元被给予一个唯一的存储器地址,称为物理地址。示例性地,物理地址从0开始编号,顺序地每次加1,因此存储器的物理地址空间是呈线性增长的。物理地址是用于寻址存储器中存储单元的地址信号,是地址变换的最终结果。处理器的外部总线可以通过系统芯片210的引脚耦合至存储器。虚拟地址是由编译程序生成的,是程序的逻辑地址。上述处理器可以是CPU、GPU以及其他处理器。In the implementation of the present invention, the address in the memory has a virtual address and a physical address, and the processor or other device accesses the data in the memory through the address. For example, information is stored in bytes in memory. To properly store or retrieve information, each byte unit is given a unique memory address, called a physical address. Illustratively, the physical addresses are numbered starting from 0, sequentially incremented by one each time, so the physical address space of the memory grows linearly. The physical address is the address signal used to address the memory locations in the memory and is the end result of the address translation. The external bus of the processor can be coupled to the memory through the pins of the system chip 210. The virtual address is generated by the compiler and is the logical address of the program. The above processors may be CPUs, GPUs, and other processors.
在本发明实施例中,虚拟内存管理(Virtual Memory Management)机制需要内存管理单元的支持。内存管理单元通常可以被视为是CPU或GPU的一部分,也可选择性位于CPU或GPU之外,即作为独立器件。如果CPU或GPU没有内存管理单元,或者有内存管理单元但没有启用,CPU或GPU执行单元发出的内存地址将直接传到芯片引脚上,如系统芯片210的引脚上,被实际物理存储器,例如被存储器215或系统芯片210中缓存器或片上存储器接收,这称为物理地址(Physical Address,PA)。如果处理器启用了内存管理单元,CPU或GPU执行单元发出的存储器地址将被内存管理单元截获,从CPU或GPU到内存管理单元的地址称为虚拟地址(Virtual Address,VA),而内存管理单元将这个地址翻译成另一个地址发到CPU或GPU所在芯片的外部地址引脚上,也就是将虚拟地址映射成物理地址。可见,内存管理单元负责虚拟地址到物理地址的映射。可以理解,内存管理单元可以将各进程对应的虚拟地址映射到该进程对应的物理地址空间,使得每个进程,例如CPU进程或GPU进程,拥有自己独立的物理地址空间。例如,内存管理单元实际生成的物理地址通常是不连续的离散地址,而虚拟地址对使用该地址的CPU或GPU而言是逻辑地址,使得所述逻辑地址看起来连续性更好。因此,在虚拟内存管理中,内存管理单元用于实现外部存储器地址到内部器件,如CPU或GPU的可使用和识别的地址之间的转换。另外,内存管理单元还可以提供硬件机制的内存访问权限检查,通过内存访问权限的检查能够保护每个进程所用的存储器中的内存不被其他进程破坏。在本发明实施例中,内存管理单元可以对GPU提供硬件机制的内存访问权限检查,保护GPU的进程所用的存储器中的内存不被其他进程破坏。In the embodiment of the present invention, the virtual memory management mechanism requires the support of the memory management unit. The memory management unit can usually be considered as part of a CPU or GPU, or it can be selectively located outside of the CPU or GPU, ie as a standalone device. If the CPU or GPU does not have a memory management unit, or has a memory management unit but is not enabled, the memory address issued by the CPU or GPU execution unit will be directly transferred to the chip pins, such as the pins of the system chip 210, and the actual physical memory. For example, it is received by the memory 215 or the buffer in the system chip 210 or the on-chip memory, which is called a physical address (PA). If the processor has the memory management unit enabled, the memory address issued by the CPU or GPU execution unit will be intercepted by the memory management unit. The address from the CPU or GPU to the memory management unit is called the virtual address (VA), and the memory management unit. Translate this address into another address and send it to the external address pin of the chip where the CPU or GPU is located, that is, map the virtual address to a physical address. It can be seen that the memory management unit is responsible for the mapping of virtual addresses to physical addresses. It can be understood that the memory management unit can map the virtual address corresponding to each process to the physical address space corresponding to the process, so that each process, such as a CPU process or a GPU process, has its own independent physical address space. For example, the physical address actually generated by the memory management unit is typically a discrete discrete address, and the virtual address is a logical address for the CPU or GPU that uses the address, making the logical address appear to be more contiguous. Therefore, in virtual memory management, a memory management unit is used to implement conversion between an external memory address to an internal device, such as a usable and identifiable address of a CPU or GPU. In addition, the memory management unit can also provide memory access check of the hardware mechanism. The memory access permission check can protect the memory in the memory used by each process from being destroyed by other processes. In the embodiment of the present invention, the memory management unit can provide a memory access permission check on the hardware mechanism of the GPU, and the memory in the memory used by the process protecting the GPU is not destroyed by other processes.
在本实施例中,业务处理装置420与图形处理器410集成在一起,并通过总线控制器440 耦合至外部总线,从而进一步耦合至数据处理装置外部的存储器。在所述装置内部,业务处理装置420与图形处理器410之间用于传输数据的通道是除了所述总线之外的其他接口。因此,业务处理装置420与图形处理器410之间的数据传输不必经过总线或外部存储器,例如总线和外部存储器均不参与到所述数据传输,节省了包括总线带宽和存储器带宽在内的系统带宽。In the present embodiment, business processing device 420 is integrated with graphics processor 410 and coupled to an external bus via bus controller 440 for further coupling to a memory external to the data processing device. Within the device, the channel between the service processing device 420 and the graphics processor 410 for transmitting data is an interface other than the bus. Therefore, the data transfer between the service processing device 420 and the graphics processor 410 does not have to go through the bus or external memory, for example, neither the bus nor the external memory participate in the data transmission, saving system bandwidth including bus bandwidth and memory bandwidth. .
在一个可选的实现方式中,提供了一种虚拟地址转换方法,具体如下:所述业务处理装置420,还用于获取业务信息;所述业务信息包含将所述第一虚拟地址转换为所述第二虚拟地址所需的信息;所述业务处理装置420,具体用于根据所述业务信息将所述第一虚拟地址转换为所述第二虚拟地址。所述业务信息至少包括如下至少一个:图像起始虚拟地址、分辨率、图像格式、步长或压缩头部信息。In an optional implementation, a virtual address translation method is provided, as follows: the service processing device 420 is further configured to acquire service information; and the service information includes converting the first virtual address into a Information required for the second virtual address; the service processing device 420 is specifically configured to convert the first virtual address into the second virtual address according to the service information. The service information includes at least one of: an image start virtual address, a resolution, an image format, a step size, or compression header information.
所述业务处理装置420可以是解压缩单元、压缩单元、加密单元或解密单元等中的至少一个。所述业务处理装置420可以执行解压操作、压缩操作、解密操作或加密操作等多种操作中的至少一个。示例性地,业务处理装置420是解压缩单元,用于将一种压缩格式的数据,如第二数据,解压缩为另一种压缩格式的数据,如第一数据。这两种格式之间的转换不改变数据的具体内容。The service processing device 420 may be at least one of a decompression unit, a compression unit, an encryption unit, or a decryption unit. The service processing device 420 may perform at least one of various operations such as a decompression operation, a compression operation, a decryption operation, or an encryption operation. Illustratively, the service processing device 420 is a decompression unit for decompressing data in one compressed format, such as second data, into data in another compressed format, such as the first data. The conversion between these two formats does not change the specific content of the data.
本实施例中的所述业务信息可以是由所述图形处理器运行的所述驱动软件生成的。所述图形处理器410或其他处理器运行的驱动软件可以生成多种业务信息。所述业务处理装置420可以根据所述图形处理器410所请求的数据,获取相应的业务信息。举例来说,图形处理器410请求加密数据,该图形处理器410或其他处理器运行的驱动软件生成第一业务信息,业务处理装置420获取该第一业务信息,该第一业务信息包含将该加密数据对应的虚拟地址转换为未加密数据对应的虚拟地址所需的信息。又举例来说,图形处理器410请求解压缩数据,该图形处理器410或其他处理器运行的驱动软件生成第二业务信息,业务处理装置420获取该第二业务信息,该第二业务信息包含将未压缩数据对应的虚拟地址转换为压缩数据对应的虚拟地址所需的信息。可以理解,所述业务信息与所述图形处理器410请求的数据以及所述业务处理装置420所需执行的操作相对应。The service information in this embodiment may be generated by the driver software running by the graphics processor. The graphics processor 410 or other processor-driven driver software can generate a variety of service information. The service processing device 420 can obtain corresponding service information according to the data requested by the graphics processor 410. For example, the graphics processor 410 requests the encrypted data, the graphics processor 410 or other driver software running by the processor generates the first service information, and the service processing device 420 acquires the first service information, where the first service information includes The virtual address corresponding to the encrypted data is converted into information required for the virtual address corresponding to the unencrypted data. For another example, the graphics processor 410 requests to decompress data, the graphics processor 410 or other driver software running by the processor generates second service information, and the service processing device 420 acquires the second service information, where the second service information includes The virtual address corresponding to the uncompressed data is converted into information required for the virtual address corresponding to the compressed data. It will be appreciated that the service information corresponds to data requested by the graphics processor 410 and operations that the service processing device 420 needs to perform.
所述业务处理装置420可以执行不同的操作,但是进行地址转换的原理类似。下面介绍业务处理装置420作为解压缩单元执行解压操作时,采用的地址转换方法的具体举例。第二数据是解压缩之前的数据,如海思帧压缩(Hisilicon Frame Buffer Compression,HFBC)格式的数据。第一数据是解压缩后的数据,能够被图形处理器使用和识别,例如是ARM(Advanced RISC Machine,高级精简指令集机器)帧压缩(ARM Frame Buffer Compression,AFBC)格式的数据。需要说明的是,以下仅是一个典型示例,本领域技术人员可以依照下面方法得到其他示例。The service processing device 420 can perform different operations, but the principles of address translation are similar. A specific example of the address conversion method employed when the service processing device 420 performs the decompression operation as the decompression unit will be described below. The second data is data before decompression, such as Hisilicon Frame Buffer Compression (HFBC) format data. The first data is decompressed data, which can be used and recognized by the graphics processor, for example, ARM (Advanced RISC Machine, Advanced Framed Instruction Set Machine) frame compression (AFBC) format data. It should be noted that the following is only a typical example, and other examples can be obtained by those skilled in the art according to the following methods.
步骤一、业务处理装置420获取目标业务信息。所述目标业务信息可以包括图像起始虚拟地址、分辨率、图像格式、步长以及压缩头部信息等。例如分辨率为1280×720的视频图像数据对应的业务信息包括:图像起始虚拟地址0x8000000000、宽度1280、高度720、步长1280以及压缩头部信息。Step 1: The service processing device 420 acquires target service information. The target service information may include an image start virtual address, a resolution, an image format, a step size, and compressed header information. For example, the service information corresponding to the video image data with a resolution of 1280×720 includes: an image start virtual address 0x8000000000, a width 1280, a height 720, a step size 1280, and compression header information.
步骤二、所述业务处理装置420确定第一虚拟地址对应的第一数据在图像中的目标坐标。举例来说,第一虚拟地址为0x8000004000,图像起始虚拟地址为0x8000000000,计算 该第一虚拟地址和该图像起始虚拟地址的差值(0x8000004000-0x8000000000=0x4000),找到第一数据位于图像的坐标(y=0x4000/1280=12,x=0x4000-1280×12=1024,所以坐标是(1024,12))。Step 2: The service processing device 420 determines target coordinates of the first data corresponding to the first virtual address in the image. For example, the first virtual address is 0x8000004000, the image starting virtual address is 0x8000000000, and the difference between the first virtual address and the starting virtual address of the image is calculated (0x8000004000-0x8000000000=0x4000), and the first data is located in the image. The coordinates (y=0x4000/1280=12, x=0x4000-1280×12=1024, so the coordinates are (1024, 12)).
步骤三、确定所述目标坐标在原始数据中对应的目标数据块。所述原始数据包含所述第一数据。所述原始数据为所述业务处理装置420处理后的数据,即未压缩的数据。图5为本申请提供的原始数据和压缩数据的结构示意图。图5中,501表示原始数据,502表示压缩数据,501包含的每一个矩形表示一个16×16的数据块,502分为两部分,上一部分为索引地址,下一部分为压缩数据,503表示第1行第M列的数据块,504表示第1行第M列的压缩数据对应的索引地址,505表示第1行第M列的压缩数据。图5中的原始数据与压缩数据相对应,业务处理装置420解压该压缩数据可以得到该原始数据。该原始数据和该压缩数据对应的起始地址相同,即501中第1行第1列的数据块对应的虚拟地址和502中第1行第1列的索引地址对应的虚拟地址相同。从图5可以看出,原始数据包含的每个数据块对应一个索引地址,每个索引地址对应一个压缩数据。例如,图5中的503对应504,504对应505。下面介绍确定目标坐标在原始数据中对应的数据块的举例:目标坐标为(1024,12),原始数据中每个数据块的大小为16×16,该目标坐标点对应的数据块为块PQ,P=12/16=0,Q=1024/16=64,该目标坐标点对应图5中第1行第64列的数据块。Step 3: Determine the target data block corresponding to the target coordinate in the original data. The raw data includes the first data. The original data is data processed by the service processing device 420, that is, uncompressed data. FIG. 5 is a schematic structural diagram of original data and compressed data provided by the present application. In FIG. 5, 501 represents original data, 502 represents compressed data, 501 includes each rectangle representing a 16×16 data block, and 502 is divided into two parts, the upper part is an index address, the lower part is compressed data, and the lower part is compressed data, and 503 indicates The data block of the Mth column of one row, 504 represents the index address corresponding to the compressed data of the first row and the Mth column, and 505 represents the compressed data of the first row and the Mth column. The original data in FIG. 5 corresponds to the compressed data, and the business processing device 420 decompresses the compressed data to obtain the original data. The original data and the compressed data correspond to the same starting address, that is, the virtual address corresponding to the data block of the first row and the first column in 501 is the same as the virtual address corresponding to the index address of the first row and the first column of 502. As can be seen from FIG. 5, each data block included in the original data corresponds to one index address, and each index address corresponds to one compressed data. For example, 503 in FIG. 5 corresponds to 504, and 504 corresponds to 505. The following describes an example of determining the corresponding data block of the target coordinate in the original data: the target coordinate is (1024, 12), the size of each data block in the original data is 16×16, and the data block corresponding to the target coordinate point is the block PQ. , P=12/16=0, Q=1024/16=64, the target coordinate point corresponds to the data block of the first row and the 64th column in FIG.
步骤四、确定所述目标数据块对应的第二虚拟地址。下面为确定原始数据中第1行第64列的数据块对应的压缩数据的虚拟地址的具体举例:Step 4: Determine a second virtual address corresponding to the target data block. The following is a specific example of determining the virtual address of the compressed data corresponding to the data block of the first row and the 64th column in the original data:
VA’_header=VA’_start+byte(header)×64;(1)VA’_header=VA’_start+byte(header)×64;(1)
VA’_body=VA’_start+data(pa_header);(2)VA’_body=VA’_start+data(pa_header);(2)
其中,VA’_start表示压缩数据的起始虚拟地址,即图5中第1行第1列的索引地址对应的虚拟地址;byte(header)表示一个索引地址占用的字节数;VA’_header表示该数据块对应的索引地址;data(pa_header)表示VA’_header存储的地址;VA’_body表示该数据块对应的压缩数据的虚拟地址,即所述第二虚拟地址。举例来说,目标数据块为原始数据中第1行第64列的数据块,即图5中503,业务处理装置利用公式(1)计算该目标数据块对应的索引地址,得到图5中的504对应的虚拟地址;获取该虚拟地址存储的参考虚拟地址,利用公式(2)和该参考虚拟地址计算该数据块对应的压缩数据的虚拟地址,得到505对应的虚拟地址。所述业务处理装置420可以包括坐标定位器、地址转换器以及解压模块。所述坐标定位器用于确定所述第一虚拟地址对应的第一数据在图像中的目标坐标。所述地址转换器用于实现所述第一虚拟地址到所述第二虚拟地址的转换,即步骤二至步骤四。所述解压模块用于对获取到的压缩数据进行解压。Where VA'_start represents the starting virtual address of the compressed data, that is, the virtual address corresponding to the index address of the first row and the first column in FIG. 5; byte (header) represents the number of bytes occupied by one index address; VA'_header represents The data address corresponds to an index address; data (pa_header) represents the address stored by the VA'_header; VA'_body represents the virtual address of the compressed data corresponding to the data block, that is, the second virtual address. For example, the target data block is the data block of the first row and the 64th column in the original data, that is, 503 in FIG. 5, and the service processing device calculates the index address corresponding to the target data block by using the formula (1), and obtains the index address in FIG. The virtual address corresponding to the virtual address is obtained by using the virtual address stored in the virtual address, and the virtual address corresponding to the compressed data corresponding to the data block is calculated by using the formula (2) and the reference virtual address to obtain a virtual address corresponding to the 505. The business processing device 420 can include a coordinate locator, an address translator, and a decompression module. The coordinate locator is configured to determine target coordinates of the first data corresponding to the first virtual address in the image. The address converter is configured to implement conversion of the first virtual address to the second virtual address, that is, steps 2 to 4. The decompression module is configured to decompress the acquired compressed data.
上面介绍了一种虚拟地址转换方法。在实际应用中,所述业务处理装置420执行的操作不同,可以采用不同的地址转换方式。例如,将未加密的第三数据对应的虚拟地址转换为加密的第四数据对应的虚拟地址,业务处理装置420解密该第四数据可以得到该第三数据。The above describes a virtual address translation method. In an actual application, the operations performed by the service processing device 420 are different, and different address translation modes may be adopted. For example, the virtual address corresponding to the unencrypted third data is converted into the virtual address corresponding to the encrypted fourth data, and the service processing device 420 decrypts the fourth data to obtain the third data.
本申请中,业务处理装置420可以将待输出数据对应的虚拟地址转换为得到该待输出数据所需的数据对应的虚拟地址,以便于该业务处理装置420得到该待输出数据,实现简单。In the present application, the service processing device 420 can convert the virtual address corresponding to the data to be output into a virtual address corresponding to the data required to obtain the data to be output, so that the service processing device 420 obtains the data to be output, which is simple to implement.
图6为本申请提供的另一种数据处理装置的结构示意图,是以图4所示装置为基础并有进一步细化。如图6所示,该数据处理装置可以是集成电路,位于系统芯片210中。该数据 处理装置包括:图形处理器620、第二内存管理单元630、地址过滤器640、业务处理装置650、第一内存管理单元660以及总线控制器670。其中,所述图形处理器620、所述第二内存管理单元630、所述地址过滤器640、所述业务处理装置650以及所述第一内存管理单元660依次耦合,所述业务处理装置650与所述总线控制器670相耦合。该数据处理装置可执行如下操作:601、图形处理器620或其他处理器运行的驱动软件配置第一映射表或第二映射表。第一映射表应用于第一内存管理单元660;第二映射表应用于第二内存管理单元630。第一映射表用于实现虚拟地址至物理地址的映射。第二映射表用于实现虚拟地址制目标地址的映射。如果该目标地址需要进一步经过其他内存管理单元或映射表转换为物理地址,则该目标地址是虚拟地址。或者,该目标地址可以就是物理地址,而无需经过其他内存管理单元或映射表进一步转换。因此,所述第二映射表可以包含至少一个虚拟地址到虚拟地址的映射关系,并且还可以进一步包含至少一个虚拟地址与至少一个物理地址的对应关系。可选地,所述第一映射表或所述第二映射表可以是所述驱动软件根据内存的占用情况动态配置的。FIG. 6 is a schematic structural diagram of another data processing apparatus provided by the present application, which is based on the apparatus shown in FIG. 4 and further refined. As shown in FIG. 6, the data processing device can be an integrated circuit located in the system chip 210. The data processing apparatus includes a graphics processor 620, a second memory management unit 630, an address filter 640, a service processing device 650, a first memory management unit 660, and a bus controller 670. The graphics processor 620, the second memory management unit 630, the address filter 640, the service processing device 650, and the first memory management unit 660 are sequentially coupled, and the service processing device 650 and The bus controller 670 is coupled. The data processing apparatus may perform the following operations: 601, the graphics processor 620 or other driver software running the driver software to configure the first mapping table or the second mapping table. The first mapping table is applied to the first memory management unit 660; the second mapping table is applied to the second memory management unit 630. The first mapping table is used to implement mapping of virtual addresses to physical addresses. The second mapping table is used to implement mapping of the virtual address system target address. If the target address needs to be further converted to a physical address by another memory management unit or mapping table, the target address is a virtual address. Alternatively, the target address can be a physical address without further conversion by other memory management units or mapping tables. Therefore, the second mapping table may include a mapping relationship of at least one virtual address to a virtual address, and may further include a correspondence between at least one virtual address and at least one physical address. Optionally, the first mapping table or the second mapping table may be dynamically configured by the driver software according to an occupation of a memory.
602、所述图形处理器向第二内存管理单元630发送第一数据获取请求。所述第一数据获取请求包括第三虚拟地址。603、所述第二内存管理单元630根据第二映射表查找与第三虚拟地址对应的目标地址并进一步向地址过滤器640发送所述目标地址。该地址过滤器640用于过滤或筛选以识别出特定的地址。602. The graphics processor sends a first data acquisition request to the second memory management unit 630. The first data acquisition request includes a third virtual address. 603. The second memory management unit 630 searches for a target address corresponding to the third virtual address according to the second mapping table, and further sends the target address to the address filter 640. The address filter 640 is used for filtering or filtering to identify a particular address.
604、在所述目标地址处于目标地址区间的情况下,所述地址过滤器640将所述目标地址输出至所述业务处理装置650,未处于所述目标地址区间的地址不被向所述业务处理装置650输出。。此时该目标地址是之前实施例提到的第一虚拟地址。605、所述业务处理装置650将所述目标地址进一步转换为第二虚拟地址并将所述第二虚拟地址输出至第一内存管理单元660。所述第二虚拟地址对应所述业务处理装置650处理前的第二数据。所述目标地址对应所述业务处理装置650处理后的第一数据。图6中的VA表示所述第三虚拟地址,VA’表示所述目标地址,VA”表示所述第二虚拟地址。可选地,所述目标地址区间可以是为所述地址过滤器预先设置的一个地址范围,也可以是所述图形处理器或其他处理器运行的驱动软件配置的一个地址范围。处于所述目标地址区间的地址可以为虚拟地址,未处于所述目标地址区间的地址可以为物理地址。所述地址过滤器可以实现地址过滤功能以区分所述物理地址和所述虚拟地址。604. If the target address is in the target address range, the address filter 640 outputs the target address to the service processing device 650, and the address not in the target address interval is not sent to the service. Processing device 650 outputs. . At this time, the target address is the first virtual address mentioned in the previous embodiment. 605. The service processing device 650 further converts the target address into a second virtual address and outputs the second virtual address to the first memory management unit 660. The second virtual address corresponds to the second data before the processing by the service processing device 650. The target address corresponds to the first data processed by the service processing device 650. VA in Fig. 6 denotes the third virtual address, VA' denotes the target address, and VA" denotes the second virtual address. Alternatively, the target address interval may be preset for the address filter An address range of the image processor may be an address range of the driver software configuration run by the graphics processor or other processor. The address in the target address interval may be a virtual address, and the address not in the target address interval may be The physical address can be implemented by the address filter to distinguish the physical address from the virtual address.
606、所述第一内存管理单元660根据第一映射表查找与所述第二虚拟地址对应的第一物理地址,并将所述第一物理地址输出至所述业务处理装置650。图6中的PA表示第一物理地址。607、所述业务处理装置650将所述第一物理地址输出至总线控制器670。608、所述业务处理装置650接收来自所述总线控制器670的所述第二数据。609、所述业务处理装置650处理所述第二数据以得到所述第一数据,将所述第一数据输出至所述图形处理器620。606. The first memory management unit 660 searches for a first physical address corresponding to the second virtual address according to the first mapping table, and outputs the first physical address to the service processing device 650. The PA in Fig. 6 represents the first physical address. 607. The service processing device 650 outputs the first physical address to the bus controller 670. The service processing device 650 receives the second data from the bus controller 670. 609. The service processing device 650 processes the second data to obtain the first data, and outputs the first data to the graphics processor 620.
可选地,610、在所述目标地址未处于所述目标地址区间的情况下,所述地址过滤器640将所述目标地址输出至总线控制器670,此时目标地址是第二物理地址,所述第二物理地址存储的数据为所述图形处理器620请求的数据。;611、所述图形处理器620接收所述总线控制器670响应于第二物理地址获取并发送的数据。由于所述地址过滤器640接收到的地址可能是所述业务处理装置650不需要的地址如物理地址,一旦所述地址过滤器640将这些地址 输出至所述业务处理装置650,会增加所述业务处理装置650不必要的操作,甚至带来不利影响。因此所述地址过滤器640仅将处于所述目标地址区间的地址输出至所述业务处理装置650,避免资源浪费。Optionally, 610. If the target address is not in the target address interval, the address filter 640 outputs the target address to the bus controller 670, where the target address is the second physical address. The data stored by the second physical address is data requested by the graphics processor 620. 611. The graphics processor 620 receives data that the bus controller 670 acquires and transmits in response to the second physical address. Since the address received by the address filter 640 may be an address that the service processing device 650 does not need, such as a physical address, once the address filter 640 outputs the address to the service processing device 650, the The business processing device 650 has unnecessary operations and even adverse effects. Therefore, the address filter 640 outputs only the address in the target address range to the service processing device 650, avoiding waste of resources.
因此,地址过滤器640用于对第二内存管理单元630生成的地址进行过滤,将在目标地址区间之内的地址提供给业务处理装置650,以便所述地址经过业务处理装置650的转换。地址过滤器640将未在目标地址区间之内的地址提供给总线控制器670,使得相关地址被直接作为物理地址使用。因此对于第二内存管理单元630而言,其生成的在目标地址区间之内的地址是另一虚拟地址或另一逻辑地址,此时该第二内存管理单元630实现的是虚拟地址至虚拟地址映射,映射前后的虚拟地址可以实质上是相同的。或者,映射后生成的另一虚拟地址与映射前的虚拟地址可以不同,例如新增了一些信息,该信息包括但不限于对应不同软件进程的标识或指示所述地址对应的业务信息的标识,以使得映射后生成的虚拟地址相对于映射前的虚拟地址有所不同。如果第二内存管理单元630生成未在目标地址区间内的地址,如在另一地址区间中,其用于实现的是虚拟地址至物理地址的映射,此时第二内存管理单元630输出的地址将直接传输给总线控制器670以便获取物理地址对应的数据。因此该装置兼容了两种不同的数据获取技术,第一种技术是需要业务处理装置650处理的数据获取技术,此时图形处理器620请求的虚拟地址在所述预设目标地址区间内,通过业务处理装置650处理外部数据,该数据被转换为图形处理器620能够识别或使用的数据但是数据内容不变。另一种技术是无需业务处理装置650参与,图形处理器620请求的虚拟地址被直接翻译为物理地址并根据该物理地址获取外部数据,此时该外部数据即是图形处理器620可识别或使用的数据,无需经过数据格式或类型的转换。Therefore, the address filter 640 is configured to filter the address generated by the second memory management unit 630, and provide an address within the target address range to the service processing device 650 for the address to be converted by the service processing device 650. The address filter 640 provides an address that is not within the target address range to the bus controller 670 such that the associated address is used directly as a physical address. Therefore, for the second memory management unit 630, the generated address within the target address range is another virtual address or another logical address, and the second memory management unit 630 implements the virtual address to the virtual address. Mapping, virtual addresses before and after mapping can be essentially the same. Alternatively, another virtual address generated after the mapping may be different from the virtual address before the mapping, for example, some information is added, including but not limited to an identifier corresponding to different software processes or an identifier indicating service information corresponding to the address. So that the virtual address generated after mapping is different from the virtual address before mapping. If the second memory management unit 630 generates an address that is not in the target address range, as in another address interval, it is used to implement mapping of the virtual address to the physical address, and the address output by the second memory management unit 630 at this time. It will be transmitted directly to the bus controller 670 to obtain data corresponding to the physical address. Therefore, the device is compatible with two different data acquisition technologies. The first technology is a data acquisition technology that needs to be processed by the service processing device 650. At this time, the virtual address requested by the graphics processor 620 passes through the preset target address interval. The business processing device 650 processes the external data, which is converted to data that the graphics processor 620 can recognize or use but the data content does not change. Another technique is that without the participation of the service processing device 650, the virtual address requested by the graphics processor 620 is directly translated into a physical address and external data is obtained according to the physical address, at which time the external data is recognized or used by the graphics processor 620. The data does not need to be converted by data format or type.
因此,本实施例的所述地址过滤器可以对输入的地址做筛选,将位于第一地址区间的地址输出至业务处理装置650,将位于不在第一地址区间内,例如在第二地址区间内的地址直接输出至总线控制器670,该第一地址区间和该第二地址区间不重叠。无论存储在外部的数据是否可直接被图形处理器620识别或使用,图形处理器620最终将获得其所需数据。可选的,该数据处理装置可以不包括地址过滤器640,也即是说地址过滤器640不是必需的,所述第二内存管理单元630和所述业务处理装置650可以直接相耦合。Therefore, the address filter of this embodiment may filter the input address, and output the address located in the first address interval to the service processing device 650, and will not be located in the first address interval, for example, in the second address interval. The address is directly output to the bus controller 670, and the first address interval and the second address interval do not overlap. Whether the data stored externally can be directly identified or used by the graphics processor 620, the graphics processor 620 will eventually obtain its required data. Optionally, the data processing apparatus may not include the address filter 640, that is, the address filter 640 is not necessary, and the second memory management unit 630 and the service processing apparatus 650 may be directly coupled.
以上方案可以节省图形处理器620获取数据时占用的系统带宽。图6中除了驱动软件之外的其他器件可以包括大量的电路,如晶体管、逻辑门电路或模拟电路中的至少一个。所述驱动软件可以存储在一个计算机可读存储介质中,并被所述图形处理器620读取和执行以生成之前实施例中所述业务信息、配置所述第一映射表或配置所述第二映射表的操作。该计算机可读存储介质可以是图2中的存储器215。所述存储器的可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,数字通用光盘(digital versatile disc,DVD))、或者半导体介质(例如,固态硬盘(solid state disk,SSD))等。The above solution can save the system bandwidth occupied by the graphics processor 620 when acquiring data. Other devices than the driver software in FIG. 6 may include a large number of circuits, such as at least one of a transistor, a logic gate circuit, or an analog circuit. The driver software may be stored in a computer readable storage medium and read and executed by the graphics processor 620 to generate the service information in the previous embodiment, configure the first mapping table, or configure the first The operation of the second mapping table. The computer readable storage medium can be the memory 215 of FIG. The available medium for the memory may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a digital versatile disc (DVD)), or a semiconductor medium (eg, a solid state disk) , SSD)) and so on.
可选地,之前实施例提及的总线控制器是总线系统的核心,其用于连接所述装置和其他器件,如系统芯片210内的其他部件或系统芯片之外的部件。总线系统包括总线和总线控制器,例如,总线控制器的任务概括地说是管理各个不同类型总线的使用,包括总线上设备的管理和设备使用总线的过程管理。在总线控制器实现技术中,并不一定存在一个独立的控制器,它的功能可能分布到各个总线相耦合的各个部件或者各个设备上。总线控制器 在本实施例中耦合于总线,并可控制总线访问外部存储器,用于根据从业务处理装置、地址过滤器或其他器件发送的物理地址控制总线从该装置外部的存储器中读取数据并反馈给图形处理器。因此该图形处理器通过使用虚拟内存管理技术可以经由该总线控制器获取存储在数据处理装置外部的数据,并加以利用。Alternatively, the bus controller referred to in the previous embodiment is the core of the bus system for connecting the device and other devices, such as other components within the system chip 210 or components other than the system chip. The bus system includes a bus and a bus controller. For example, the task of the bus controller is generally to manage the use of various types of buses, including the management of devices on the bus and the process management of the devices using the bus. In the bus controller implementation technology, there is not necessarily a separate controller, and its functions may be distributed to various components or devices coupled to each bus. The bus controller is coupled to the bus in this embodiment and can control the bus to access an external memory for reading data from a memory external to the device based on a physical address control bus transmitted from a service processing device, address filter or other device. And feedback to the graphics processor. Therefore, the graphics processor can acquire and utilize data stored outside the data processing device via the bus controller by using virtual memory management technology.
在以上实施中,由于所述装置通过内部的总线控制器被附着在总线上,并进一步连接至总线上的存储器,装置内部的不同部件之间不需要通过总线传输数据。该存储器可以是系统芯片的外部存储器或者是片上存储器或者是缓存器等临时存储设备。当业务处理装置向图形处理器提供图形处理器请求的数据的时候,数据传输不会经过装置外的总线,也不需要存储在耦合与总线的其他存储器上,可以节省系统带宽,并可以进一步节省系统的存储空间。可选地,业务处理装置与图形处理器之间用于传输所述数据的通道是除了总线之外的其他接口,如专用的电路接口。因此,本申请实施例相当于包括图形处理器的所述装置内嵌入有业务处理装置模块,使得该业务处理装置与图形处理器之间的数据传输不经过总线和外部存储器,可灵活的实现不同数据类型或格式的转换以便于图形处理器识别和使用,并能够有效节省带宽。In the above implementation, since the device is attached to the bus through an internal bus controller and further connected to the memory on the bus, there is no need to transfer data between the different components inside the device via the bus. The memory may be an external memory of the system chip or an on-chip memory or a temporary storage device such as a buffer. When the business processing device provides the data requested by the graphics processor to the graphics processor, the data transmission does not pass through the bus outside the device, nor does it need to be stored in other memories coupled to the bus, which can save system bandwidth and further save The storage space of the system. Optionally, the channel between the service processing device and the graphics processor for transmitting the data is an interface other than the bus, such as a dedicated circuit interface. Therefore, the embodiment of the present application is equivalent to embedding a service processing device module in the device including the graphics processor, so that data transmission between the service processing device and the graphics processor does not pass through the bus and the external memory, and can be flexibly implemented differently. The conversion of data types or formats is easy for the graphics processor to recognize and use, and can effectively save bandwidth.
需要说明的是,本申请提到的“耦合”一词,用于表达不同部件之间的互通或互相作用,可以包括直接相连或通过其他部件间接相连。本实施例中涉及的至少一个用于表示广义上的一个或多个,即可以用于表达对应的多个选项中的一个或任意多个。It should be noted that the term "coupled" as used in this application is used to mean the intercommunication or interaction between different components, and may include direct connection or indirect connection through other components. At least one of the embodiments is used to represent one or more in a broad sense, that is, to express one or any of a plurality of corresponding options.
以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以权利要求的保护范围为准。The above is only the specific embodiment of the present invention, but the scope of the present invention is not limited thereto, and any equivalent person can be easily conceived within the technical scope of the present invention by any person skilled in the art. Modifications or substitutions are intended to be included within the scope of the invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims (16)

  1. 一种数据处理装置,其特征在于,包括:图形处理器、业务处理装置以及第一内存管理单元;所述图形处理器与所述第一内存管理单元分别与业务处理装置耦合;A data processing device, comprising: a graphics processor, a service processing device, and a first memory management unit; wherein the graphics processor and the first memory management unit are respectively coupled to a service processing device;
    所述图形处理器,用于请求第一虚拟地址对应的第一数据,所述第一数据为所述业务处理装置处理后的数据且能够被所述图形处理器使用或识别;The graphics processor is configured to request first data corresponding to the first virtual address, where the first data is data processed by the service processing device and can be used or recognized by the graphics processor;
    所述业务处理装置,用于将所述第一虚拟地址转换为第二虚拟地址并将所述第二虚拟地址输出至所述第一内存管理单元,所述第二虚拟地址对应所述业务处理装置处理前的第二数据;The service processing device is configured to convert the first virtual address into a second virtual address and output the second virtual address to the first memory management unit, where the second virtual address corresponds to the service processing Second data before processing by the device;
    所述第一内存管理单元,用于根据第一映射表查找与所述第二虚拟地址对应的第一物理地址;The first memory management unit is configured to search for a first physical address corresponding to the second virtual address according to the first mapping table;
    所述业务处理装置,还用于获取在存储器内的所述第一物理地址存储的所述第二数据,所述第二数据不能够被所述图形处理器使用或识别,所述数据处理装置通过总线耦合至所述存储器;The service processing device is further configured to acquire the second data stored in the first physical address in a memory, the second data cannot be used or recognized by the graphics processor, and the data processing device Coupled to the memory by a bus;
    所述业务处理装置,还用于处理所述第二数据以得到所述第一数据,在没有所述总线或所述存储器中的一个或全部参与的情况下将所述第一数据输出至所述图形处理器。The service processing device is further configured to process the second data to obtain the first data, and output the first data to the device without one or all of the bus or the memory participating The graphics processor.
  2. 根据权利要求1所述的数据处理装置,其特征在于,A data processing apparatus according to claim 1, wherein
    所述业务处理装置,还用于获取业务信息;所述业务信息包含将所述第一虚拟地址转换为所述第二虚拟地址所需的信息;The service processing device is further configured to acquire service information; the service information includes information required to convert the first virtual address into the second virtual address;
    所述业务处理装置,具体用于根据所述业务信息将所述第一虚拟地址转换为所述第二虚拟地址。The service processing device is specifically configured to convert the first virtual address into the second virtual address according to the service information.
  3. 根据权利要求1或2所述的数据处理装置,其特征在于,所述数据处理装置还包括第二内存管理单元;The data processing device according to claim 1 or 2, wherein the data processing device further comprises a second memory management unit;
    所述图形处理器,具体用于向所述第二内存管理单元发送第一数据获取请求,所述第一数据获取请求包括第三虚拟地址,所述第三虚拟地址用于指示所述第一虚拟地址;The graphics processor is configured to send a first data acquisition request to the second memory management unit, where the first data acquisition request includes a third virtual address, and the third virtual address is used to indicate the first Virtual address
    所述第二内存管理单元,用于根据第二映射表查找与所述第三虚拟地址对应的所述第一虚拟地址并进一步向所述业务处理装置请求所述第一虚拟地址对应的所述第一数据。The second memory management unit is configured to search the first virtual address corresponding to the third virtual address according to the second mapping table, and further request the service processing device to correspond to the first virtual address First data.
  4. 根据权利要求3所述的数据处理装置,其特征在于,所述图形处理器通过运行驱动软件执行以下至少一个操作:生成所述业务信息、配置所述第一映射表或配置所述第二映射表。The data processing apparatus according to claim 3, wherein said graphics processor performs at least one of: generating said service information, configuring said first mapping table, or configuring said second mapping by running driver software table.
  5. 根据权利要求1至4中任一项所述的数据处理装置,其特征在于,A data processing apparatus according to any one of claims 1 to 4, characterized in that
    所述业务处理装置,具体用于接收所述第一内存管理单元输入的所述第一物理地址,将所述第一物理地址输出至总线控制器,并接收所述总线控制器输出的所述第二数据,所述总线控制器通过所述总线耦合至所述存储器。The service processing device is specifically configured to receive the first physical address input by the first memory management unit, output the first physical address to a bus controller, and receive the output by the bus controller Second data, the bus controller is coupled to the memory via the bus.
  6. 根据权利要求3至5中任一项所述的数据处理装置,其特征在于,所述数据处理装置还包括地址过滤器;The data processing apparatus according to any one of claims 3 to 5, wherein the data processing apparatus further comprises an address filter;
    所述第二内存管理单元,具体用于向所述地址过滤器发送所述第一虚拟地址;The second memory management unit is specifically configured to send the first virtual address to the address filter;
    所述地址过滤器,用于接收所述第一虚拟地址,在所述第一虚拟地址处于目标地址区间的情况下,将所述第一虚拟地址输出至所述业务处理装置。The address filter is configured to receive the first virtual address, and output the first virtual address to the service processing device if the first virtual address is in a target address interval.
  7. 根据权利要求6所述的数据处理装置,其特征在于,A data processing apparatus according to claim 6, wherein
    所述图形处理器,还用于向所述第二内存管理单元发送第二数据获取请求,所述第二数据获取请求包括第四虚拟地址;The graphics processor is further configured to send a second data acquisition request to the second memory management unit, where the second data acquisition request includes a fourth virtual address;
    所述第二内存管理单元,还用于根据所述第二映射表查找与所述第四虚拟地址对应的第二物理地址并向所述地址过滤器发送所述第二物理地址;The second memory management unit is further configured to search for a second physical address corresponding to the fourth virtual address according to the second mapping table, and send the second physical address to the address filter;
    所述地址过滤器,还用于接收所述第二物理地址,在所述第二物理地址未处于所述目标地址区间的情况下,通过总线控制器获取所述第二物理地址存储的第三数据,并输出所述第三数据至所述图形处理器。The address filter is further configured to receive the second physical address, where the second physical address is not in the target address interval, acquire the third storage of the second physical address by using a bus controller Data and outputting the third data to the graphics processor.
  8. 根据权利要求1至7中任一项所述的数据处理装置,其特征在于,所述业务处理装置包括如下至少一个:解压缩单元、压缩单元、解密单元或加密单元。The data processing apparatus according to any one of claims 1 to 7, wherein the service processing apparatus comprises at least one of: a decompression unit, a compression unit, a decryption unit, or an encryption unit.
  9. 一种数据处理方法,应用于数据处理装置,其特征在于,所述数据处理装置包括图形处理器、业务处理装置以及第一内存管理单元,所述方法包括:A data processing method is applied to a data processing device, wherein the data processing device comprises a graphics processor, a service processing device, and a first memory management unit, the method comprising:
    所述图形处理器请求第一虚拟地址对应的第一数据,所述第一数据为所述业务处理装置处理后的数据且能够被所述图形处理器使用或识别;The graphics processor requests first data corresponding to the first virtual address, the first data is data processed by the service processing device and can be used or recognized by the graphics processor;
    所述业务处理装置将所述第一虚拟地址转换为第二虚拟地址并将所述第二虚拟地址输出至所述第一内存管理单元,所述第二虚拟地址对应所述业务处理装置处理前的第二数据;The service processing device converts the first virtual address into a second virtual address and outputs the second virtual address to the first memory management unit, where the second virtual address corresponds to the processing by the service processing device Second data;
    所述第一内存管理单元根据第一映射表查找与所述第二虚拟地址对应的第一物理地址;The first memory management unit searches for a first physical address corresponding to the second virtual address according to the first mapping table;
    所述业务处理装置获取在存储器内的所述第一物理地址存储的所述第二数据,所述第二数据不能够被所述图形处理器使用或识别,所述数据处理装置通过总线耦合至所述存储器;The service processing device acquires the second data stored in the first physical address in a memory, the second data is not usable or recognized by the graphics processor, and the data processing device is coupled to the bus through a bus The memory;
    所述业务处理装置处理所述第二数据以得到所述第一数据,在没有所述总线或所述存储器中的一个或全部参与的情况下将所述第一数据输出至所述图形处理器。The service processing device processes the second data to obtain the first data, and outputs the first data to the graphics processor without one or all of the bus or the memory participating .
  10. 根据权利要求9所述的数据处理方法,其特征在于,所述业务处理装置将所述第一虚拟地址转换为第二虚拟地址包括:The data processing method according to claim 9, wherein the converting the first virtual address to the second virtual address by the service processing device comprises:
    所述业务处理装置获取业务信息;所述业务信息包含将所述第一虚拟地址转换为所述第二虚拟地址所需的信息;The service processing device acquires service information; the service information includes information required to convert the first virtual address to the second virtual address;
    所述业务处理装置根据所述业务信息将所述第一虚拟地址转换为所述第二虚拟地址。The service processing device converts the first virtual address into the second virtual address according to the service information.
  11. 根据权利要求9或10所述的数据处理方法,其特征在于,所述数据处理装置还包括与所述图形处理器相耦合的第二内存管理单元;所述图形处理器请求第一虚拟地址对应的第一数据包括:The data processing method according to claim 9 or 10, wherein said data processing device further comprises a second memory management unit coupled to said graphics processor; said graphics processor requesting a first virtual address corresponding The first data includes:
    所述图形处理器向所述第二内存管理单元发送第一数据获取请求,所述第一数据获取请求包括第三虚拟地址,所述第三虚拟地址用于指示所述第一虚拟地址;The graphics processor sends a first data acquisition request to the second memory management unit, where the first data acquisition request includes a third virtual address, and the third virtual address is used to indicate the first virtual address;
    所述第二内存管理单元根据第二映射表查找与所述第三虚拟地址对应的所述第一虚拟地址并进一步向所述业务处理装置请求所述第一虚拟地址对应的所述第一数据。Searching, by the second memory management unit, the first virtual address corresponding to the third virtual address according to the second mapping table, and further requesting, by the service processing device, the first data corresponding to the first virtual address .
  12. 根据权利要求11所述的数据处理方法,其特征在于,所述方法还包括执行以下至少一个操作:The data processing method according to claim 11, wherein the method further comprises performing at least one of the following operations:
    生成所述业务信息、配置所述第一映射表或配置所述第二映射表。Generating the service information, configuring the first mapping table, or configuring the second mapping table.
  13. 根据权利要求9至11任一项所述的数据处理方法,其特征在于,所述业务处理装置获取在存储器内的所述第一物理地址存储的所述第二数据包括:The data processing method according to any one of claims 9 to 11, wherein the acquiring, by the service processing device, the second data stored in the first physical address in the memory comprises:
    所述业务处理装置接收所述第一内存管理单元输入的所述第一物理地址;将所述第一物理地址输出至总线控制器,并接收所述总线控制器输出的所述第二数据,所述总线控制器通过所述总线耦合至所述存储器。Receiving, by the service processing device, the first physical address input by the first memory management unit; outputting the first physical address to a bus controller, and receiving the second data output by the bus controller, The bus controller is coupled to the memory via the bus.
  14. 根据权利要求11至13任一项所述的数据处理方法,其特征在于,所述数据处理装置还包括分别与所述第二内存管理单元和所述业务处理装置耦合的地址过滤器;所述业务处理装置将所述第二虚拟地址转换为第三虚拟地址之前,所述方法还包括:The data processing method according to any one of claims 11 to 13, wherein said data processing device further comprises an address filter coupled to said second memory management unit and said service processing device, respectively; Before the service processing device converts the second virtual address to the third virtual address, the method further includes:
    所述第二内存管理单元向所述地址过滤器发送所述第一虚拟地址;Sending, by the second memory management unit, the first virtual address to the address filter;
    所述地址过滤器接收所述第二内存管理单元输入的所述第一虚拟地址;在所述第一虚拟地址处于目标地址区间的情况下,将所述第一虚拟地址输出至所述业务处理装置。The address filter receives the first virtual address input by the second memory management unit; and when the first virtual address is in a target address interval, outputting the first virtual address to the service processing Device.
  15. 根据权利要求14所述的数据处理方法,其特征在于,所述方法还包括:The data processing method according to claim 14, wherein the method further comprises:
    所述图形处理器向所述第二内存管理单元发送第二数据获取请求,所述第二数据获取请求包括第四虚拟地址;The graphics processor sends a second data acquisition request to the second memory management unit, where the second data acquisition request includes a fourth virtual address;
    所述第二内存管理单元根据所述第二映射表查找与所述第四虚拟地址对应的第二物理地址并向所述地址过滤器发送所述第二物理地址;The second memory management unit searches for a second physical address corresponding to the fourth virtual address according to the second mapping table, and sends the second physical address to the address filter;
    所述地址过滤器接收所述第二物理地址,在所述第二物理地址未处于所述目标地址区间的情况下,通过总线控制器获取所述第二物理地址存储的第三数据,并输出所述第三数据至所述图形处理器。The address filter receives the second physical address, and if the second physical address is not in the target address interval, acquires third data stored by the second physical address by using a bus controller, and outputs The third data is to the graphics processor.
  16. 根据权利要求9至15中任一项所述的数据处理方法,其特征在于,所述业务处理装置包括如下至少一个:解压缩单元、压缩单元、解密单元或加密单元。The data processing method according to any one of claims 9 to 15, wherein the service processing device comprises at least one of: a decompression unit, a compression unit, a decryption unit, or an encryption unit.
PCT/CN2019/079438 2018-04-13 2019-03-25 Data processing method and apparatus WO2019196634A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810330125.9 2018-04-13
CN201810330125.9A CN110377534B (en) 2018-04-13 2018-04-13 Data processing method and device

Publications (1)

Publication Number Publication Date
WO2019196634A1 true WO2019196634A1 (en) 2019-10-17

Family

ID=68163973

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/079438 WO2019196634A1 (en) 2018-04-13 2019-03-25 Data processing method and apparatus

Country Status (2)

Country Link
CN (1) CN110377534B (en)
WO (1) WO2019196634A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114298890B (en) * 2021-12-02 2024-01-30 格兰菲智能科技有限公司 Data processing apparatus and method thereof
TWI806747B (en) * 2022-08-22 2023-06-21 創鑫智慧股份有限公司 Computing device and data access method therefor

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103108186A (en) * 2013-02-21 2013-05-15 中国对外翻译出版有限公司 Method of achieving high-definition transmission of videos
CN103841389A (en) * 2014-04-02 2014-06-04 北京奇艺世纪科技有限公司 Video playing method and player
CN103986929A (en) * 2013-02-13 2014-08-13 瑞萨电子株式会社 Image processing device
US20150093036A1 (en) * 2013-10-02 2015-04-02 Yong-Ha Park Video/image data processing system and method of processing video/image data
CN106796712A (en) * 2014-10-01 2017-05-31 高通股份有限公司 Transparent pixels format converter

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9373182B2 (en) * 2012-08-17 2016-06-21 Intel Corporation Memory sharing via a unified memory architecture
CN106663060B (en) * 2014-10-07 2019-11-19 谷歌有限责任公司 Method and system for cache lines duplicate removal
US11100004B2 (en) * 2015-06-23 2021-08-24 Advanced Micro Devices, Inc. Shared virtual address space for heterogeneous processors
US10719447B2 (en) * 2016-09-26 2020-07-21 Intel Corporation Cache and compression interoperability in a graphics processor pipeline

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103986929A (en) * 2013-02-13 2014-08-13 瑞萨电子株式会社 Image processing device
CN103108186A (en) * 2013-02-21 2013-05-15 中国对外翻译出版有限公司 Method of achieving high-definition transmission of videos
US20150093036A1 (en) * 2013-10-02 2015-04-02 Yong-Ha Park Video/image data processing system and method of processing video/image data
CN103841389A (en) * 2014-04-02 2014-06-04 北京奇艺世纪科技有限公司 Video playing method and player
CN106796712A (en) * 2014-10-01 2017-05-31 高通股份有限公司 Transparent pixels format converter

Also Published As

Publication number Publication date
CN110377534B (en) 2023-11-17
CN110377534A (en) 2019-10-25

Similar Documents

Publication Publication Date Title
US11531623B2 (en) Memory sharing via a unified memory architecture
US9906713B2 (en) Camera command set host command translation
US9686460B2 (en) Enabling a metadata storage subsystem
JP2014534522A (en) Multi-touch interface method
RU2656727C1 (en) Compression control surfaces supported by virtual memory
WO2019196634A1 (en) Data processing method and apparatus
CN112887608A (en) Image processing method and device, image processing chip and electronic equipment
US9864635B2 (en) Reducing the number of read/write operations performed by a CPU to duplicate source data to enable parallel processing on the source data
KR100663380B1 (en) Imaging device and method for transferring image signal
US9600296B2 (en) Executing a command within a transport mechanism based on a get and set architecture
WO2020163977A1 (en) Virtual flash
JP2003177958A (en) Specialized memory device
US20220164130A1 (en) Method and system of standards-based audio function processing with reduced memory usage
US9417726B2 (en) Supporting keyboard and mouse over embedded displayport without using a universal serial bus
US10168985B2 (en) Dynamic audio codec enumeration
CN117785726A (en) Application processor, system on chip and operation method thereof
KR20110091337A (en) Mobile storage control device

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19785455

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19785455

Country of ref document: EP

Kind code of ref document: A1