[COMMON] g2d: add task management
G2D driver does not configure SFRs of G2D from the image processing
information from userspace. It just verifies a set of SFR values from
userspace and forwards to H/W the SFR values.
The possible number of SFR values is 830, and H/W limits the number to
1024, we have decided to maintain the pools of the buffers to store
the SFR values from userspace because allocation of 8KB at run-time
may consume a lot of time.
We also decided to create 16 buffers to store the SFR values which is
called 'Command list' because G2D H/W accepts 16 compositing jobs in
maximum.
We call entries in the pool as 'task' and a task has the following
elements:
- JOB ID that is used by H/W to distinguish jobs
- Descriptions of 16 source layers and the target image
- Buffer descriptions of each layer
- Command list
The life time of a task:
A new task is registered to tasks_free list of g2d_device. If a
compositing job is requested by userspace, G2D driver pulls a task
from tasks_free list and configures the task for the requested
compositing. When the configuration is finished, the task is
registered to tasks_prepared list. Therefore all tasks registered to
tasks_prepared are ready to be pushed to H/W. If a task should be wait
for fences to be signaled, it is not registered to tasks_prepared list
until the fence is signaled. As a result, tasks are listed in
tasks_prepared in a very short time except the system is falling into
suspend to RAM. The tasks remained in tasks_prepared are pushed to the
H/W as soon as the system is woken up from supend to RAM.
When H/W completes composting of a pushed task, it is removed from
tasks_active and returned to tasks_free.
The implemetation of the life cycle of tasks is included in the
following patch series.
Change-Id: I38f11020fc27e48c05d05e39ed9dc9ae28f9eb58
Signed-off-by: hyesoo.yu <hyesoo.yu@samsung.com>
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>