[RFC v5 0/5] drm/exynos: add ipp subsystem and each ipp drivers

2012-12-14 Thread Eunchul Kim
Hi All.

I am responsible for a display part from Samsung Electronics Telecommunication 
Division.
and I am going to add post-processing features in exynos drm.
If you have some opinions of this patch,
please give some comments about my patch.

Changelog v5:
This RFC v5 changed TODO list for arrangement.
Supports devm_ fuction in resource handling.
Arranged comments and added description.
Changed return value for right detect error.
Added GSC definition.

Changelog v4:
This RFC v4 changed ipp subsystem for arrangement.
Remove EXPORT_SYMBOL_GPL in ipp subsystem.
Added error handling in ipp subsystem.
Change set_transf return from swap to ret and use pointer about swap.
Seperated function in Rotator.

Changelog v3:
This RFC v3 changed ipp subsystem for arrangement.
Fixed scaler problem in GSC.
Added/Removed comment from Inki.Dae.
Fixed Joonyoung.Shim comment.
Added rotator comments.

Changelog v2:
This RFC v2 supports iommu in ipp. and Added/Removed comment from Inki.Dae.
Fixed GSC part bugs and next time I will send our local git commit.
and We finished implementation of SC for post-processing.
SC driver not fully tested yet. so, I didn't add SC feature in this patch.

Changelog v1:

This patch is post-processing(IPP) support for exynos drm driver.

IPP is stands for Image Post Processing and supports image scaler/rotator
and input/output DMA operations using IPP drivers(FIMC, Rotator, GSC, SC, so 
on.)
IPP is integration device driver of same attibute hardware.

Exynos4 SoC support FIMC, Rotator for post-processing.
and Exynos5 SoC support GSC, Rotator, SC for post-processing.
SC driver not tested yet. so, I didn't add SC feature in this patch.
and IPP subsystem works on Exynos SoC version independently.

IPP drivers supports Memory to Memory operations with various converting.
and some drivers supports Writeback and Display output operations using local 
path.
User can make converted image using this driver.
and also supports streaming concept for multimedia data processing.

And supports various operations
1. Scale operation generates various sizes of image.
2. CSC(Color Space Conversion) operation supports format converting.
3. Crop operation supports cutting the image.
4. Rotate operation supports to 90, 180, 270 degree.
5. Flip operation supports to vertical, horizontal, and both.
6. Writeback operation genertates cloned image from display controller(FIMD).
7. Display output operation support various format display to display 
controller(FIMD).
8. Input DMA reads image data from the memory.
9. Output DMA writes image data to memory.
10. Supports image effect functions.

Descriptions)
User should make property informations and set this property to registers.
and IPP subsystem manages property id using command node and make queue list 
using memory node.
IPP subsystem supports register function of IPP drivers.
IPP driver manages input/output DMA with various operations. and some driver 
supports
optional operations(writeback, output).
IPP driver needs various informations, so User set property information to IPP 
driver.
and also IPP driver needs memory base address of image for various operations.
User doesn't know its address, so fills the gem handle of that memory than 
address of image base.
and than IPP driver start operation.

Ioctls)
We adds four ioctls and one event for IPP subsystem.

- ioctls
DRM_EXYNOS_IPP_GET_PROPERTY : get ipp driver capabilitis and id.
DRM_EXYNOS_IPP_SET_PROPERTY : set format, position, rotation, flip about 
source/destination.
DRM_EXYNOS_IPP_QUEUE_BUF : enqueue/dequeue buffer and make event list.
DRM_EXYNOS_IPP_CMD_CTRL : play/stop/pause/resume control.

- event
DRM_EXYNOS_IPP_EVENT : event to give notification completion of buffer DMA with 
buffer list

Basic control flow and Sample pseudo application)
1. Basic control flow is same as below
Open -> Get properties -> User choose IPP driver and set property information 
-> Set Property -> Create gem handle ->
Queue buffer(Enqueue) of source/destination -> Command control(Play) -> Event 
occured to User
-> User handle converted image -> (Queue buffer(Enqueue) of source/destination 
-> Event occured to User)*N ->
Queue buffer(Dequeue) of source/destination -> Command control(Stop) -> Free 
gem handle -> Close

2. Sample pseudo application
#include "exynos_drm.h"
static int exynos_drm_ipp_set_property(int fd ...)
{
struct drm_exynos_pos crop_pos = {0, 0, hsize, vsize};
struct drm_exynos_pos scale_pos = {0, 0, hsize, vsize};
struct drm_exynos_sz src_sz = {hsize, vsize};
struct drm_exynos_sz dst_sz = {hsize, vsize};
int ret = 0;

memset(property, 0x00, sizeof(struct drm_exynos_ipp_property));
property->cmd = cmd;

property->config[EXYNOS_DRM_OPS_SRC].ops_id = EXYNOS_DRM_OPS_SRC;
property->config[EXYNOS_DRM_OPS_SRC].flip = EXYNOS_DRM_FLIP_NONE;
property->config[EXYNOS_DRM_OPS_SRC].degree = EXYNOS_DRM_DEGREE_0;

[RFC v5 0/5] drm/exynos: add ipp subsystem and each ipp drivers

2012-12-14 Thread Eunchul Kim
Hi All.

I am responsible for a display part from Samsung Electronics Telecommunication 
Division.
and I am going to add post-processing features in exynos drm.
If you have some opinions of this patch,
please give some comments about my patch.

Changelog v5:
This RFC v5 changed TODO list for arrangement.
Supports devm_ fuction in resource handling.
Arranged comments and added description.
Changed return value for right detect error.
Added GSC definition.

Changelog v4:
This RFC v4 changed ipp subsystem for arrangement.
Remove EXPORT_SYMBOL_GPL in ipp subsystem.
Added error handling in ipp subsystem.
Change set_transf return from swap to ret and use pointer about swap.
Seperated function in Rotator.

Changelog v3:
This RFC v3 changed ipp subsystem for arrangement.
Fixed scaler problem in GSC.
Added/Removed comment from Inki.Dae.
Fixed Joonyoung.Shim comment.
Added rotator comments.

Changelog v2:
This RFC v2 supports iommu in ipp. and Added/Removed comment from Inki.Dae.
Fixed GSC part bugs and next time I will send our local git commit.
and We finished implementation of SC for post-processing.
SC driver not fully tested yet. so, I didn't add SC feature in this patch.

Changelog v1:

This patch is post-processing(IPP) support for exynos drm driver.

IPP is stands for Image Post Processing and supports image scaler/rotator
and input/output DMA operations using IPP drivers(FIMC, Rotator, GSC, SC, so 
on.)
IPP is integration device driver of same attibute hardware.

Exynos4 SoC support FIMC, Rotator for post-processing.
and Exynos5 SoC support GSC, Rotator, SC for post-processing.
SC driver not tested yet. so, I didn't add SC feature in this patch.
and IPP subsystem works on Exynos SoC version independently.

IPP drivers supports Memory to Memory operations with various converting.
and some drivers supports Writeback and Display output operations using local 
path.
User can make converted image using this driver.
and also supports streaming concept for multimedia data processing.

And supports various operations
1. Scale operation generates various sizes of image.
2. CSC(Color Space Conversion) operation supports format converting.
3. Crop operation supports cutting the image.
4. Rotate operation supports to 90, 180, 270 degree.
5. Flip operation supports to vertical, horizontal, and both.
6. Writeback operation genertates cloned image from display controller(FIMD).
7. Display output operation support various format display to display 
controller(FIMD).
8. Input DMA reads image data from the memory.
9. Output DMA writes image data to memory.
10. Supports image effect functions.

Descriptions)
User should make property informations and set this property to registers.
and IPP subsystem manages property id using command node and make queue list 
using memory node.
IPP subsystem supports register function of IPP drivers.
IPP driver manages input/output DMA with various operations. and some driver 
supports
optional operations(writeback, output).
IPP driver needs various informations, so User set property information to IPP 
driver.
and also IPP driver needs memory base address of image for various operations.
User doesn't know its address, so fills the gem handle of that memory than 
address of image base.
and than IPP driver start operation.

Ioctls)
We adds four ioctls and one event for IPP subsystem.

- ioctls
DRM_EXYNOS_IPP_GET_PROPERTY : get ipp driver capabilitis and id.
DRM_EXYNOS_IPP_SET_PROPERTY : set format, position, rotation, flip about 
source/destination.
DRM_EXYNOS_IPP_QUEUE_BUF : enqueue/dequeue buffer and make event list.
DRM_EXYNOS_IPP_CMD_CTRL : play/stop/pause/resume control.

- event
DRM_EXYNOS_IPP_EVENT : event to give notification completion of buffer DMA with 
buffer list

Basic control flow and Sample pseudo application)
1. Basic control flow is same as below
Open - Get properties - User choose IPP driver and set property information 
- Set Property - Create gem handle -
Queue buffer(Enqueue) of source/destination - Command control(Play) - Event 
occured to User
- User handle converted image - (Queue buffer(Enqueue) of source/destination 
- Event occured to User)*N -
Queue buffer(Dequeue) of source/destination - Command control(Stop) - Free 
gem handle - Close

2. Sample pseudo application
#include exynos_drm.h
static int exynos_drm_ipp_set_property(int fd ...)
{
struct drm_exynos_pos crop_pos = {0, 0, hsize, vsize};
struct drm_exynos_pos scale_pos = {0, 0, hsize, vsize};
struct drm_exynos_sz src_sz = {hsize, vsize};
struct drm_exynos_sz dst_sz = {hsize, vsize};
int ret = 0;

memset(property, 0x00, sizeof(struct drm_exynos_ipp_property));
property-cmd = cmd;

property-config[EXYNOS_DRM_OPS_SRC].ops_id = EXYNOS_DRM_OPS_SRC;
property-config[EXYNOS_DRM_OPS_SRC].flip = EXYNOS_DRM_FLIP_NONE;
property-config[EXYNOS_DRM_OPS_SRC].degree = EXYNOS_DRM_DEGREE_0;
property-config[EXYNOS_DRM_OPS_SRC].fmt =