Method and apparatus for managing video memory in embedded device
AssigneeMStar Semiconductor, Inc.
InventorHu He
Life of this patent
Estimating the term…
Abstract
A method for managing an image memory in an embedded device is provided. A node is obtained from a linked list of the image memory. It is judged whether valid data is present in a memory block corresponding to the node. When no valid data is present, it is judged whether valid data is present in a memory block corresponding to a previous node of the node. When valid data is present in the previous node, it is further judged whether the valid data is movable. When the valid data is movable, memory block information described in the two nodes is exchanged, and the valid data previously stored in the memory block corresponding to the previous node is moved to the memory block corresponding to the node.
Claims10
A method for managing an image memory in an embedded device, comprising:
- obtaining a node from a linked list of the image memory;
- judging whether valid data is present in a memory block corresponding to the node in the image memory;
- judging whether valid data is present in a memory block corresponding to a previous node in the image memory when no valid data is present in the memory block corresponding to the node;
- judging whether the valid data is movable when valid data is present in the memory block corresponding to the previous node;
- when the valid data stored in the memory block corresponding to the previous node is movable, exchanging memory block information in the node with memory block information in the previous node, and moving the valid data stored in the memory block corresponding to the previous node to the memory block corresponding to the node,
- after the step of judging whether valid data is present in the memory block corresponding to the node, the method further comprising, when valid data is present in the memory block corresponding to the node, obtaining a previous node of the node and performing the step of judging whether valid data is present in the memory block corresponding to the previous node until a first node in the linked list of the image memory is obtained;
- and
- after the step of judging whether the valid data stored in the memory block corresponding to the previous node is movable, the method further comprising, when it is judged the valid data stored in the memory block corresponding to the previous node is immovable, obtaining a previous node of the previous node and performing the step of judging whether valid data is present in the memo T block corresponding to the obtained node until the first node in the linked list of the image memory is obtained,
- wherein the step of judging whether the valid data stored in the memory block corresponding to the previous node is movable comprises judging whether the memory block corresponding to the previous node is a layer surface;
- wherein when the memory block corresponding to the previous node is the layer surface, the valid data stored in the memory block corresponding to the previous node is immovable;
- and
- when the memory block corresponding to the previous node is not the layer surface, judging whether the memory block corresponding to the previous node is locked;
- wherein, when the memory block corresponding to the previous node is locked, the valid data stored in the memory block corresponding to the previous node is immovable.
An apparatus for managing an image memory in an embedded device, comprising:
- a first obtaining module, for obtaining a node from a linked list of the image memory;
- a first judging module, for judging whether valid data is present in a memory block corresponding to the node obtained by the first obtaining module;
- a second judging module, for judging whether valid data is present in a memory block corresponding to a previous node when no valid data is present in the memory block corresponding to the node obtained by the first obtaining module;
- a third judging module, for judging whether the valid data is movable when valid data is present in the memory block corresponding to the previous node;
- and
- an exchange module, when the valid data stored in the memory block corresponding to the previous node is movable, for exchanging memory block information in the node with memory block information in the previous node, and moving the valid data stored in the memory block corresponding to the previous node to the memory block corresponding to the node;
- a second obtaining module, when the first judging module judges valid data is present in the memory block corresponding to the node, for obtaining the previous node of the node;
- wherein the second judging module judges whether valid data is present in the memory block corresponding to the previous node until a first node of the linked list is obtained,
- wherein when the first judging module judges no valid data is present in the memory block corresponding to the node, the second judging module judges valid data is present in the memory block corresponding to the previous node and the third judging module judges the valid data stored in the memory block corresponding to the previous node is immovable, the second obtaining module obtains a previous node of the previous node;
- and the second judging module judges whether valid data is present in the memory block corresponding to the obtained node until the first node of the linked list is obtained,
- wherein the third judging module comprises:
- a first judging unit, for judging whether the memory block corresponding to the previous node of the obtained node is a layer surface;
- wherein the valid data stored in the memory block corresponding to the previous node is immovable when the memory block corresponding to the previous node is the layer surface;
- a second judging unit, for judging whether the memory block corresponding to the previous node is locked when the first judging unit judges the memory block corresponding to the previous node is not the layer surface;
- wherein when the memory block corresponding to the previous node is locked, the valid data stored in the memory block corresponding to the previous node is immovable;
- and
- a third judging unit, for judging whether the memory block corresponding to the previous node is recently accessed by a GPU when the first judging module judges the memory block corresponding to the previous node is not the layer surface and the second judging module judges the memory block corresponding to the previous node is not locked;
- wherein when the memory block corresponding to the previous node is recently accessed by the GPU, the valid data stored in the memory block corresponding to the previous node is only moved after the GPU completes accessing.
Dependencies are inferred from the claim text.