[PATCH 09/10] drm/exynos: add G2D driver

2013-01-22 Thread Inki Dae
2013/1/21 Rob Clark :
> I don't suppose you could send a libdrm patch to the list with an up
> to date version of the g2dtest code so we can get it in libdrm tree?
>

We are planning on updating exynos drm for libdrm. At that time, the
up to date version of the g2dtest will be posted.
Joonyoung, let it post. And I will post other things except g2dtest.

Thanks,
Inki Dae

> BR,
> -R
>
> On Fri, Mar 16, 2012 at 1:28 AM, Joonyoung Shim  
> wrote:
>> On 03/15/2012 07:50 PM, Dave Airlie wrote:

 G2D is a 2D graphic accelerator that supports Bit Block Transfer. This
 G2D driver is exynos drm specific and supports only exynos4x12 series.
 user application fills command set in cmdlist and once dma start request
 these cmdlists are parsed and performed by dma.
>>>
>>> Where is this block documented or a pointer to the corresponding open
>>> userspace user code?
>>
>>
>> I attach simple g2dtest program patch. The base of this patch is master
>> branch of lastest libdrm git.
>>
>> This user progrem can test just solid color fill example.
>> I will cleanup and update it for more operations later.
>>
>> Thanks.
>>
>>
>>> Again the ioctls look like they need to be depointered and use __u64.
>>>
>>> It would be nice if you could document how the command stream and engine
>>> work.
>>>
>>> How does userspace pass addresses to it? straight or via gem objects?
>>> how does it
>>> stop userspace blt to places it shouldn't etc.
>>>
>>> I'm getting the feeling this accel enabled driver needs a lot more of
>>> a commit message
>>> and lot more documentation on what it can be used for.
>>>
>>> Dave.
>>> ___
>>> dri-devel mailing list
>>> dri-devel at lists.freedesktop.org
>>> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>>>
>>
>>
>> ___
>> dri-devel mailing list
>> dri-devel at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>>
> ___
> dri-devel mailing list
> dri-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 09/10] drm/exynos: add G2D driver

2013-01-21 Thread Rob Clark
On Mon, Jan 21, 2013 at 7:33 PM, Inki Dae  wrote:
> 2013/1/21 Rob Clark :
>> I don't suppose you could send a libdrm patch to the list with an up
>> to date version of the g2dtest code so we can get it in libdrm tree?
>>
>
> We are planning on updating exynos drm for libdrm. At that time, the
> up to date version of the g2dtest will be posted.
> Joonyoung, let it post. And I will post other things except g2dtest.

thanks, I just want to make sure this doesn't get lost

BR,
-R

> Thanks,
> Inki Dae
>
>> BR,
>> -R
>>
>> On Fri, Mar 16, 2012 at 1:28 AM, Joonyoung Shim  
>> wrote:
>>> On 03/15/2012 07:50 PM, Dave Airlie wrote:
>
> G2D is a 2D graphic accelerator that supports Bit Block Transfer. This
> G2D driver is exynos drm specific and supports only exynos4x12 series.
> user application fills command set in cmdlist and once dma start request
> these cmdlists are parsed and performed by dma.

 Where is this block documented or a pointer to the corresponding open
 userspace user code?
>>>
>>>
>>> I attach simple g2dtest program patch. The base of this patch is master
>>> branch of lastest libdrm git.
>>>
>>> This user progrem can test just solid color fill example.
>>> I will cleanup and update it for more operations later.
>>>
>>> Thanks.
>>>
>>>
 Again the ioctls look like they need to be depointered and use __u64.

 It would be nice if you could document how the command stream and engine
 work.

 How does userspace pass addresses to it? straight or via gem objects?
 how does it
 stop userspace blt to places it shouldn't etc.

 I'm getting the feeling this accel enabled driver needs a lot more of
 a commit message
 and lot more documentation on what it can be used for.

 Dave.
 ___
 dri-devel mailing list
 dri-devel at lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/dri-devel

>>>
>>>
>>> ___
>>> dri-devel mailing list
>>> dri-devel at lists.freedesktop.org
>>> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>>>
>> ___
>> dri-devel mailing list
>> dri-devel at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 09/10] drm/exynos: add G2D driver

2013-01-21 Thread Rob Clark
On Mon, Jan 21, 2013 at 7:33 PM, Inki Dae  wrote:
> 2013/1/21 Rob Clark :
>> I don't suppose you could send a libdrm patch to the list with an up
>> to date version of the g2dtest code so we can get it in libdrm tree?
>>
>
> We are planning on updating exynos drm for libdrm. At that time, the
> up to date version of the g2dtest will be posted.
> Joonyoung, let it post. And I will post other things except g2dtest.

thanks, I just want to make sure this doesn't get lost

BR,
-R

> Thanks,
> Inki Dae
>
>> BR,
>> -R
>>
>> On Fri, Mar 16, 2012 at 1:28 AM, Joonyoung Shim  
>> wrote:
>>> On 03/15/2012 07:50 PM, Dave Airlie wrote:
>
> G2D is a 2D graphic accelerator that supports Bit Block Transfer. This
> G2D driver is exynos drm specific and supports only exynos4x12 series.
> user application fills command set in cmdlist and once dma start request
> these cmdlists are parsed and performed by dma.

 Where is this block documented or a pointer to the corresponding open
 userspace user code?
>>>
>>>
>>> I attach simple g2dtest program patch. The base of this patch is master
>>> branch of lastest libdrm git.
>>>
>>> This user progrem can test just solid color fill example.
>>> I will cleanup and update it for more operations later.
>>>
>>> Thanks.
>>>
>>>
 Again the ioctls look like they need to be depointered and use __u64.

 It would be nice if you could document how the command stream and engine
 work.

 How does userspace pass addresses to it? straight or via gem objects?
 how does it
 stop userspace blt to places it shouldn't etc.

 I'm getting the feeling this accel enabled driver needs a lot more of
 a commit message
 and lot more documentation on what it can be used for.

 Dave.
 ___
 dri-devel mailing list
 dri-devel@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/dri-devel

>>>
>>>
>>> ___
>>> dri-devel mailing list
>>> dri-devel@lists.freedesktop.org
>>> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>>>
>> ___
>> dri-devel mailing list
>> dri-devel@lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/dri-devel
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 09/10] drm/exynos: add G2D driver

2013-01-21 Thread Inki Dae
2013/1/21 Rob Clark :
> I don't suppose you could send a libdrm patch to the list with an up
> to date version of the g2dtest code so we can get it in libdrm tree?
>

We are planning on updating exynos drm for libdrm. At that time, the
up to date version of the g2dtest will be posted.
Joonyoung, let it post. And I will post other things except g2dtest.

Thanks,
Inki Dae

> BR,
> -R
>
> On Fri, Mar 16, 2012 at 1:28 AM, Joonyoung Shim  
> wrote:
>> On 03/15/2012 07:50 PM, Dave Airlie wrote:

 G2D is a 2D graphic accelerator that supports Bit Block Transfer. This
 G2D driver is exynos drm specific and supports only exynos4x12 series.
 user application fills command set in cmdlist and once dma start request
 these cmdlists are parsed and performed by dma.
>>>
>>> Where is this block documented or a pointer to the corresponding open
>>> userspace user code?
>>
>>
>> I attach simple g2dtest program patch. The base of this patch is master
>> branch of lastest libdrm git.
>>
>> This user progrem can test just solid color fill example.
>> I will cleanup and update it for more operations later.
>>
>> Thanks.
>>
>>
>>> Again the ioctls look like they need to be depointered and use __u64.
>>>
>>> It would be nice if you could document how the command stream and engine
>>> work.
>>>
>>> How does userspace pass addresses to it? straight or via gem objects?
>>> how does it
>>> stop userspace blt to places it shouldn't etc.
>>>
>>> I'm getting the feeling this accel enabled driver needs a lot more of
>>> a commit message
>>> and lot more documentation on what it can be used for.
>>>
>>> Dave.
>>> ___
>>> dri-devel mailing list
>>> dri-devel@lists.freedesktop.org
>>> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>>>
>>
>>
>> ___
>> dri-devel mailing list
>> dri-devel@lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>>
> ___
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 09/10] drm/exynos: add G2D driver

2013-01-20 Thread Rob Clark
I don't suppose you could send a libdrm patch to the list with an up
to date version of the g2dtest code so we can get it in libdrm tree?

BR,
-R

On Fri, Mar 16, 2012 at 1:28 AM, Joonyoung Shim  
wrote:
> On 03/15/2012 07:50 PM, Dave Airlie wrote:
>>>
>>> G2D is a 2D graphic accelerator that supports Bit Block Transfer. This
>>> G2D driver is exynos drm specific and supports only exynos4x12 series.
>>> user application fills command set in cmdlist and once dma start request
>>> these cmdlists are parsed and performed by dma.
>>
>> Where is this block documented or a pointer to the corresponding open
>> userspace user code?
>
>
> I attach simple g2dtest program patch. The base of this patch is master
> branch of lastest libdrm git.
>
> This user progrem can test just solid color fill example.
> I will cleanup and update it for more operations later.
>
> Thanks.
>
>
>> Again the ioctls look like they need to be depointered and use __u64.
>>
>> It would be nice if you could document how the command stream and engine
>> work.
>>
>> How does userspace pass addresses to it? straight or via gem objects?
>> how does it
>> stop userspace blt to places it shouldn't etc.
>>
>> I'm getting the feeling this accel enabled driver needs a lot more of
>> a commit message
>> and lot more documentation on what it can be used for.
>>
>> Dave.
>> ___
>> dri-devel mailing list
>> dri-devel at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>>
>
>
> ___
> dri-devel mailing list
> dri-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>


Re: [PATCH 09/10] drm/exynos: add G2D driver

2013-01-20 Thread Rob Clark
I don't suppose you could send a libdrm patch to the list with an up
to date version of the g2dtest code so we can get it in libdrm tree?

BR,
-R

On Fri, Mar 16, 2012 at 1:28 AM, Joonyoung Shim  wrote:
> On 03/15/2012 07:50 PM, Dave Airlie wrote:
>>>
>>> G2D is a 2D graphic accelerator that supports Bit Block Transfer. This
>>> G2D driver is exynos drm specific and supports only exynos4x12 series.
>>> user application fills command set in cmdlist and once dma start request
>>> these cmdlists are parsed and performed by dma.
>>
>> Where is this block documented or a pointer to the corresponding open
>> userspace user code?
>
>
> I attach simple g2dtest program patch. The base of this patch is master
> branch of lastest libdrm git.
>
> This user progrem can test just solid color fill example.
> I will cleanup and update it for more operations later.
>
> Thanks.
>
>
>> Again the ioctls look like they need to be depointered and use __u64.
>>
>> It would be nice if you could document how the command stream and engine
>> work.
>>
>> How does userspace pass addresses to it? straight or via gem objects?
>> how does it
>> stop userspace blt to places it shouldn't etc.
>>
>> I'm getting the feeling this accel enabled driver needs a lot more of
>> a commit message
>> and lot more documentation on what it can be used for.
>>
>> Dave.
>> ___
>> dri-devel mailing list
>> dri-devel@lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>>
>
>
> ___
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 09/10] drm/exynos: add G2D driver

2012-03-16 Thread Joonyoung Shim
On 03/15/2012 07:50 PM, Dave Airlie wrote:
>> G2D is a 2D graphic accelerator that supports Bit Block Transfer. This
>> G2D driver is exynos drm specific and supports only exynos4x12 series.
>> user application fills command set in cmdlist and once dma start request
>> these cmdlists are parsed and performed by dma.
> Where is this block documented or a pointer to the corresponding open
> userspace user code?

I attach simple g2dtest program patch. The base of this patch is master
branch of lastest libdrm git.

This user progrem can test just solid color fill example.
I will cleanup and update it for more operations later.

Thanks.

> Again the ioctls look like they need to be depointered and use __u64.
>
> It would be nice if you could document how the command stream and engine work.
>
> How does userspace pass addresses to it? straight or via gem objects?
> how does it
> stop userspace blt to places it shouldn't etc.
>
> I'm getting the feeling this accel enabled driver needs a lot more of
> a commit message
> and lot more documentation on what it can be used for.
>
> Dave.
> ___
> dri-devel mailing list
> dri-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>



Re: [PATCH 09/10] drm/exynos: add G2D driver

2012-03-15 Thread Joonyoung Shim

On 03/15/2012 07:50 PM, Dave Airlie wrote:

G2D is a 2D graphic accelerator that supports Bit Block Transfer. This
G2D driver is exynos drm specific and supports only exynos4x12 series.
user application fills command set in cmdlist and once dma start request
these cmdlists are parsed and performed by dma.

Where is this block documented or a pointer to the corresponding open
userspace user code?


I attach simple g2dtest program patch. The base of this patch is master
branch of lastest libdrm git.

This user progrem can test just solid color fill example.
I will cleanup and update it for more operations later.

Thanks.


Again the ioctls look like they need to be depointered and use __u64.

It would be nice if you could document how the command stream and engine work.

How does userspace pass addresses to it? straight or via gem objects?
how does it
stop userspace blt to places it shouldn't etc.

I'm getting the feeling this accel enabled driver needs a lot more of
a commit message
and lot more documentation on what it can be used for.

Dave.
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel



>From 845c0a1bbf67b342099c5eae6f573063af8fc023 Mon Sep 17 00:00:00 2001
From: Joonyoung Shim 
Date: Fri, 16 Mar 2012 15:13:45 +0900
Subject: [PATCH] Add simple g2dtest

This can test only solid color fill.

Signed-off-by: Joonyoung Shim 
---
 configure.ac  |1 +
 include/drm/exynos_drm.h  |  185 ++
 tests/Makefile.am |2 +-
 tests/g2dtest/Makefile.am |   16 ++
 tests/g2dtest/g2d.h   |   64 +
 tests/g2dtest/g2d_reg.h   |  108 
 tests/g2dtest/g2dtest.c   |  612 +
 7 files changed, 987 insertions(+), 1 deletions(-)
 create mode 100644 include/drm/exynos_drm.h
 create mode 100644 tests/g2dtest/Makefile.am
 create mode 100644 tests/g2dtest/g2d.h
 create mode 100644 tests/g2dtest/g2d_reg.h
 create mode 100644 tests/g2dtest/g2dtest.c

diff --git a/configure.ac b/configure.ac
index 71a596c..1b51b65 100644
--- a/configure.ac
+++ b/configure.ac
@@ -297,6 +297,7 @@ AC_CONFIG_FILES([
 	tests/kmstest/Makefile
 	tests/radeon/Makefile
 	tests/vbltest/Makefile
+	tests/g2dtest/Makefile
 	include/Makefile
 	include/drm/Makefile
 	libdrm.pc])
diff --git a/include/drm/exynos_drm.h b/include/drm/exynos_drm.h
new file mode 100644
index 000..701dbd9
--- /dev/null
+++ b/include/drm/exynos_drm.h
@@ -0,0 +1,185 @@
+/* exynos_drm.h
+ *
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd.
+ * Authors:
+ *	Inki Dae 
+ *	Joonyoung Shim 
+ *	Seung-Woo Kim 
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#ifndef _EXYNOS_DRM_H_
+#define _EXYNOS_DRM_H_
+
+#include "drm.h"
+
+/**
+ * User-desired buffer creation information structure.
+ *
+ * @size: user-desired memory allocation size.
+ *	- this size value would be page-aligned internally.
+ * @flags: user request for setting memory type or cache attributes.
+ * @handle: returned a handle to created gem object.
+ *	- this handle will be set by gem module of kernel side.
+ */
+struct drm_exynos_gem_create {
+	uint64_t size;
+	unsigned int flags;
+	unsigned int handle;
+};
+
+/**
+ * A structure for getting buffer offset.
+ *
+ * @handle: a pointer to gem object created.
+ * @pad: just padding to be 64-bit aligned.
+ * @offset: relatived offset value of the memory region allocated.
+ *	- this value should be set by user.
+ */
+struct drm_exynos_gem_map_off {
+	unsigned int handle;
+	unsigned int pad;
+	uint64_t offset;
+};
+
+/**
+ * A structure for mapping buffer.
+ *
+ * @handle: a handle to gem object created.
+ * @size: memory size to be mapped.
+ * @mapped: having user virtual address mmaped.
+ *	- this variable would be filled by exynos gem module
+ *	of kernel side with user virtual address which is allocated
+ *	

[PATCH 09/10] drm/exynos: add G2D driver

2012-03-15 Thread Joonyoung Shim
On 03/15/2012 07:50 PM, Dave Airlie wrote:
>> G2D is a 2D graphic accelerator that supports Bit Block Transfer. This
>> G2D driver is exynos drm specific and supports only exynos4x12 series.
>> user application fills command set in cmdlist and once dma start request
>> these cmdlists are parsed and performed by dma.
> Where is this block documented or a pointer to the corresponding open
> userspace user code?
>
> Again the ioctls look like they need to be depointered and use __u64.
>
> It would be nice if you could document how the command stream and engine work.
>
> How does userspace pass addresses to it? straight or via gem objects?
> how does it
> stop userspace blt to places it shouldn't etc.
>
> I'm getting the feeling this accel enabled driver needs a lot more of
> a commit message
> and lot more documentation on what it can be used for.

OK, i will update the more documentation and simple user space program.

Thanks.


[PATCH 09/10] drm/exynos: add G2D driver

2012-03-15 Thread Dave Airlie
>
> G2D is a 2D graphic accelerator that supports Bit Block Transfer. This
> G2D driver is exynos drm specific and supports only exynos4x12 series.
> user application fills command set in cmdlist and once dma start request
> these cmdlists are parsed and performed by dma.

Where is this block documented or a pointer to the corresponding open
userspace user code?

Again the ioctls look like they need to be depointered and use __u64.

It would be nice if you could document how the command stream and engine work.

How does userspace pass addresses to it? straight or via gem objects?
how does it
stop userspace blt to places it shouldn't etc.

I'm getting the feeling this accel enabled driver needs a lot more of
a commit message
and lot more documentation on what it can be used for.

Dave.


Re: [PATCH 09/10] drm/exynos: add G2D driver

2012-03-15 Thread Joonyoung Shim

On 03/15/2012 07:50 PM, Dave Airlie wrote:

G2D is a 2D graphic accelerator that supports Bit Block Transfer. This
G2D driver is exynos drm specific and supports only exynos4x12 series.
user application fills command set in cmdlist and once dma start request
these cmdlists are parsed and performed by dma.

Where is this block documented or a pointer to the corresponding open
userspace user code?

Again the ioctls look like they need to be depointered and use __u64.

It would be nice if you could document how the command stream and engine work.

How does userspace pass addresses to it? straight or via gem objects?
how does it
stop userspace blt to places it shouldn't etc.

I'm getting the feeling this accel enabled driver needs a lot more of
a commit message
and lot more documentation on what it can be used for.


OK, i will update the more documentation and simple user space program.

Thanks.
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 09/10] drm/exynos: add G2D driver

2012-03-15 Thread Dave Airlie
>
> G2D is a 2D graphic accelerator that supports Bit Block Transfer. This
> G2D driver is exynos drm specific and supports only exynos4x12 series.
> user application fills command set in cmdlist and once dma start request
> these cmdlists are parsed and performed by dma.

Where is this block documented or a pointer to the corresponding open
userspace user code?

Again the ioctls look like they need to be depointered and use __u64.

It would be nice if you could document how the command stream and engine work.

How does userspace pass addresses to it? straight or via gem objects?
how does it
stop userspace blt to places it shouldn't etc.

I'm getting the feeling this accel enabled driver needs a lot more of
a commit message
and lot more documentation on what it can be used for.

Dave.
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[RESEND][PATCH 09/10] drm/exynos: add G2D driver

2012-03-14 Thread Inki Dae
From: Joonyoung Shim 

G2D is a 2D graphic accelerator that supports Bit Block Transfer. This
G2D driver is exynos drm specific.

This adds below three exynos specific ioctl and one event for G2D.
 - DRM_EXYNOS_G2D_GET_VER
 - DRM_EXYNOS_G2D_SET_CMDLIST
 - DRM_EXYNOS_G2D_EXEC
 - DRM_EXYNOS_G2D_EVENT

Signed-off-by: Joonyoung Shim 
Signed-off-by: Inki Dae 
Signed-off-by: Kyungmin Park 
---
 drivers/gpu/drm/exynos/Kconfig  |6 +
 drivers/gpu/drm/exynos/Makefile |1 +
 drivers/gpu/drm/exynos/exynos_drm_drv.c |   31 ++
 drivers/gpu/drm/exynos/exynos_drm_drv.h |   13 +
 drivers/gpu/drm/exynos/exynos_drm_g2d.c |  885 +++
 drivers/gpu/drm/exynos/exynos_drm_g2d.h |   36 ++
 include/drm/exynos_drm.h|   56 ++
 7 files changed, 1028 insertions(+), 0 deletions(-)
 create mode 100644 drivers/gpu/drm/exynos/exynos_drm_g2d.c
 create mode 100644 drivers/gpu/drm/exynos/exynos_drm_g2d.h

diff --git a/drivers/gpu/drm/exynos/Kconfig b/drivers/gpu/drm/exynos/Kconfig
index 9a9850a..8493fe9 100644
--- a/drivers/gpu/drm/exynos/Kconfig
+++ b/drivers/gpu/drm/exynos/Kconfig
@@ -21,3 +21,9 @@ config DRM_EXYNOS_HDMI
depends on DRM_EXYNOS && !VIDEO_SAMSUNG_S5P_TV
help
  Choose this option if you want to use Exynos HDMI for DRM.
+
+config DRM_EXYNOS_G2D
+   bool "Exynos DRM G2D"
+   depends on DRM_EXYNOS
+   help
+ Choose this option if you want to use Exynos G2D for DRM.
diff --git a/drivers/gpu/drm/exynos/Makefile b/drivers/gpu/drm/exynos/Makefile
index 5331fa3..d6c1a3c 100644
--- a/drivers/gpu/drm/exynos/Makefile
+++ b/drivers/gpu/drm/exynos/Makefile
@@ -12,5 +12,6 @@ exynosdrm-$(CONFIG_DRM_EXYNOS_FIMD)   += exynos_drm_fimd.o
 exynosdrm-$(CONFIG_DRM_EXYNOS_HDMI)+= exynos_hdmi.o exynos_mixer.o \
   exynos_ddc.o exynos_hdmiphy.o \
   exynos_drm_hdmi.o
+exynosdrm-$(CONFIG_DRM_EXYNOS_G2D) += exynos_drm_g2d.o

 obj-$(CONFIG_DRM_EXYNOS)   += exynosdrm.o
diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c 
b/drivers/gpu/drm/exynos/exynos_drm_drv.c
index b4e265f..2b72c5d 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_drv.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c
@@ -37,6 +37,7 @@
 #include "exynos_drm_fbdev.h"
 #include "exynos_drm_fb.h"
 #include "exynos_drm_gem.h"
+#include "exynos_drm_g2d.h"
 #include "exynos_drm_plane.h"

 #define DRIVER_NAME"exynos"
@@ -146,8 +147,16 @@ static int exynos_drm_unload(struct drm_device *dev)

 static int exynos_drm_open(struct drm_device *dev, struct drm_file *file)
 {
+   struct drm_exynos_file_private *file_priv;
+
DRM_DEBUG_DRIVER("%s\n", __FILE__);

+   file_priv = kzalloc(sizeof(*file_priv), GFP_KERNEL);
+   if (!file_priv)
+   return -ENOMEM;
+
+   file->driver_priv = file_priv;
+
return exynos_drm_subdrv_open(dev, file);
 }

@@ -208,6 +217,13 @@ static struct drm_ioctl_desc exynos_ioctls[] = {
exynos_drm_gem_mmap_ioctl, DRM_UNLOCKED | DRM_AUTH),
DRM_IOCTL_DEF_DRV(EXYNOS_PLANE_SET_ZPOS, exynos_plane_set_zpos_ioctl,
DRM_UNLOCKED | DRM_AUTH),
+
+   DRM_IOCTL_DEF_DRV(EXYNOS_G2D_GET_VER,
+   exynos_g2d_get_ver_ioctl, DRM_UNLOCKED | DRM_AUTH),
+   DRM_IOCTL_DEF_DRV(EXYNOS_G2D_SET_CMDLIST,
+   exynos_g2d_set_cmdlist_ioctl, DRM_UNLOCKED | DRM_AUTH),
+   DRM_IOCTL_DEF_DRV(EXYNOS_G2D_EXEC,
+   exynos_g2d_exec_ioctl, DRM_UNLOCKED | DRM_AUTH),
 };

 static const struct file_operations exynos_drm_driver_fops = {
@@ -298,6 +314,12 @@ static int __init exynos_drm_init(void)
goto out_common_hdmi;
 #endif

+#ifdef CONFIG_DRM_EXYNOS_G2D
+   ret = platform_driver_register(&g2d_driver);
+   if (ret < 0)
+   goto out_g2d;
+#endif
+
ret = platform_driver_register(&exynos_drm_platform_driver);
if (ret < 0)
goto out;
@@ -305,6 +327,11 @@ static int __init exynos_drm_init(void)
return 0;

 out:
+#ifdef CONFIG_DRM_EXYNOS_G2D
+   platform_driver_unregister(&g2d_driver);
+out_g2d:
+#endif
+
 #ifdef CONFIG_DRM_EXYNOS_HDMI
platform_driver_unregister(&exynos_drm_common_hdmi_driver);
 out_common_hdmi:
@@ -327,6 +354,10 @@ static void __exit exynos_drm_exit(void)

platform_driver_unregister(&exynos_drm_platform_driver);

+#ifdef CONFIG_DRM_EXYNOS_G2D
+   platform_driver_unregister(&g2d_driver);
+#endif
+
 #ifdef CONFIG_DRM_EXYNOS_HDMI
platform_driver_unregister(&exynos_drm_common_hdmi_driver);
platform_driver_unregister(&mixer_driver);
diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h 
b/drivers/gpu/drm/exynos/exynos_drm_drv.h
index b26c2f4..750daa9 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_drv.h
+++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h
@@ -203,6 +203,18 @@ struct exynos_drm_manager {
struct exynos_drm_display_op

[PATCH 09/10] drm/exynos: add G2D driver

2012-03-13 Thread Inki Dae
From: Joonyoung Shim 

G2D is a 2D graphic accelerator that supports Bit Block Transfer. This
G2D driver is exynos drm specific and supports only exynos4x12 series.
user application fills command set in cmdlist and once dma start request
these cmdlists are parsed and performed by dma.

This adds below three exynos specific ioctl and one event for G2D.
 - DRM_EXYNOS_G2D_GET_VER
 - DRM_EXYNOS_G2D_SET_CMDLIST
 - DRM_EXYNOS_G2D_EXEC
 - DRM_EXYNOS_G2D_EVENT

Signed-off-by: Joonyoung Shim 
Signed-off-by: Inki Dae 
Signed-off-by: Kyungmin Park 
---
 drivers/gpu/drm/exynos/Kconfig  |6 +
 drivers/gpu/drm/exynos/Makefile |1 +
 drivers/gpu/drm/exynos/exynos_drm_drv.c |   31 ++
 drivers/gpu/drm/exynos/exynos_drm_drv.h |   11 +
 drivers/gpu/drm/exynos/exynos_drm_g2d.c |  864 +++
 drivers/gpu/drm/exynos/exynos_drm_g2d.h |   36 ++
 include/drm/exynos_drm.h|   56 ++
 7 files changed, 1005 insertions(+), 0 deletions(-)
 create mode 100644 drivers/gpu/drm/exynos/exynos_drm_g2d.c
 create mode 100644 drivers/gpu/drm/exynos/exynos_drm_g2d.h

diff --git a/drivers/gpu/drm/exynos/Kconfig b/drivers/gpu/drm/exynos/Kconfig
index 9a9850a..8493fe9 100644
--- a/drivers/gpu/drm/exynos/Kconfig
+++ b/drivers/gpu/drm/exynos/Kconfig
@@ -21,3 +21,9 @@ config DRM_EXYNOS_HDMI
depends on DRM_EXYNOS && !VIDEO_SAMSUNG_S5P_TV
help
  Choose this option if you want to use Exynos HDMI for DRM.
+
+config DRM_EXYNOS_G2D
+   bool "Exynos DRM G2D"
+   depends on DRM_EXYNOS
+   help
+ Choose this option if you want to use Exynos G2D for DRM.
diff --git a/drivers/gpu/drm/exynos/Makefile b/drivers/gpu/drm/exynos/Makefile
index 5331fa3..d6c1a3c 100644
--- a/drivers/gpu/drm/exynos/Makefile
+++ b/drivers/gpu/drm/exynos/Makefile
@@ -12,5 +12,6 @@ exynosdrm-$(CONFIG_DRM_EXYNOS_FIMD)   += exynos_drm_fimd.o
 exynosdrm-$(CONFIG_DRM_EXYNOS_HDMI)+= exynos_hdmi.o exynos_mixer.o \
   exynos_ddc.o exynos_hdmiphy.o \
   exynos_drm_hdmi.o
+exynosdrm-$(CONFIG_DRM_EXYNOS_G2D) += exynos_drm_g2d.o

 obj-$(CONFIG_DRM_EXYNOS)   += exynosdrm.o
diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c 
b/drivers/gpu/drm/exynos/exynos_drm_drv.c
index b4e265f..2b72c5d 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_drv.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c
@@ -37,6 +37,7 @@
 #include "exynos_drm_fbdev.h"
 #include "exynos_drm_fb.h"
 #include "exynos_drm_gem.h"
+#include "exynos_drm_g2d.h"
 #include "exynos_drm_plane.h"

 #define DRIVER_NAME"exynos"
@@ -146,8 +147,16 @@ static int exynos_drm_unload(struct drm_device *dev)

 static int exynos_drm_open(struct drm_device *dev, struct drm_file *file)
 {
+   struct drm_exynos_file_private *file_priv;
+
DRM_DEBUG_DRIVER("%s\n", __FILE__);

+   file_priv = kzalloc(sizeof(*file_priv), GFP_KERNEL);
+   if (!file_priv)
+   return -ENOMEM;
+
+   file->driver_priv = file_priv;
+
return exynos_drm_subdrv_open(dev, file);
 }

@@ -208,6 +217,13 @@ static struct drm_ioctl_desc exynos_ioctls[] = {
exynos_drm_gem_mmap_ioctl, DRM_UNLOCKED | DRM_AUTH),
DRM_IOCTL_DEF_DRV(EXYNOS_PLANE_SET_ZPOS, exynos_plane_set_zpos_ioctl,
DRM_UNLOCKED | DRM_AUTH),
+
+   DRM_IOCTL_DEF_DRV(EXYNOS_G2D_GET_VER,
+   exynos_g2d_get_ver_ioctl, DRM_UNLOCKED | DRM_AUTH),
+   DRM_IOCTL_DEF_DRV(EXYNOS_G2D_SET_CMDLIST,
+   exynos_g2d_set_cmdlist_ioctl, DRM_UNLOCKED | DRM_AUTH),
+   DRM_IOCTL_DEF_DRV(EXYNOS_G2D_EXEC,
+   exynos_g2d_exec_ioctl, DRM_UNLOCKED | DRM_AUTH),
 };

 static const struct file_operations exynos_drm_driver_fops = {
@@ -298,6 +314,12 @@ static int __init exynos_drm_init(void)
goto out_common_hdmi;
 #endif

+#ifdef CONFIG_DRM_EXYNOS_G2D
+   ret = platform_driver_register(&g2d_driver);
+   if (ret < 0)
+   goto out_g2d;
+#endif
+
ret = platform_driver_register(&exynos_drm_platform_driver);
if (ret < 0)
goto out;
@@ -305,6 +327,11 @@ static int __init exynos_drm_init(void)
return 0;

 out:
+#ifdef CONFIG_DRM_EXYNOS_G2D
+   platform_driver_unregister(&g2d_driver);
+out_g2d:
+#endif
+
 #ifdef CONFIG_DRM_EXYNOS_HDMI
platform_driver_unregister(&exynos_drm_common_hdmi_driver);
 out_common_hdmi:
@@ -327,6 +354,10 @@ static void __exit exynos_drm_exit(void)

platform_driver_unregister(&exynos_drm_platform_driver);

+#ifdef CONFIG_DRM_EXYNOS_G2D
+   platform_driver_unregister(&g2d_driver);
+#endif
+
 #ifdef CONFIG_DRM_EXYNOS_HDMI
platform_driver_unregister(&exynos_drm_common_hdmi_driver);
platform_driver_unregister(&mixer_driver);
diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h 
b/drivers/gpu/drm/exynos/exynos_drm_drv.h
index b26c2f4..d7b50e5 100644
--- a/drivers/gpu/dr

[RESEND][PATCH 09/10] drm/exynos: add G2D driver

2012-03-13 Thread Inki Dae
From: Joonyoung Shim 

G2D is a 2D graphic accelerator that supports Bit Block Transfer. This
G2D driver is exynos drm specific.

This adds below three exynos specific ioctl and one event for G2D.
 - DRM_EXYNOS_G2D_GET_VER
 - DRM_EXYNOS_G2D_SET_CMDLIST
 - DRM_EXYNOS_G2D_EXEC
 - DRM_EXYNOS_G2D_EVENT

Signed-off-by: Joonyoung Shim 
Signed-off-by: Inki Dae 
Signed-off-by: Kyungmin Park 
---
 drivers/gpu/drm/exynos/Kconfig  |6 +
 drivers/gpu/drm/exynos/Makefile |1 +
 drivers/gpu/drm/exynos/exynos_drm_drv.c |   31 ++
 drivers/gpu/drm/exynos/exynos_drm_drv.h |   13 +
 drivers/gpu/drm/exynos/exynos_drm_g2d.c |  885 +++
 drivers/gpu/drm/exynos/exynos_drm_g2d.h |   36 ++
 include/drm/exynos_drm.h|   56 ++
 7 files changed, 1028 insertions(+), 0 deletions(-)
 create mode 100644 drivers/gpu/drm/exynos/exynos_drm_g2d.c
 create mode 100644 drivers/gpu/drm/exynos/exynos_drm_g2d.h

diff --git a/drivers/gpu/drm/exynos/Kconfig b/drivers/gpu/drm/exynos/Kconfig
index 9a9850a..8493fe9 100644
--- a/drivers/gpu/drm/exynos/Kconfig
+++ b/drivers/gpu/drm/exynos/Kconfig
@@ -21,3 +21,9 @@ config DRM_EXYNOS_HDMI
depends on DRM_EXYNOS && !VIDEO_SAMSUNG_S5P_TV
help
  Choose this option if you want to use Exynos HDMI for DRM.
+
+config DRM_EXYNOS_G2D
+   bool "Exynos DRM G2D"
+   depends on DRM_EXYNOS
+   help
+ Choose this option if you want to use Exynos G2D for DRM.
diff --git a/drivers/gpu/drm/exynos/Makefile b/drivers/gpu/drm/exynos/Makefile
index 5331fa3..d6c1a3c 100644
--- a/drivers/gpu/drm/exynos/Makefile
+++ b/drivers/gpu/drm/exynos/Makefile
@@ -12,5 +12,6 @@ exynosdrm-$(CONFIG_DRM_EXYNOS_FIMD)   += exynos_drm_fimd.o
 exynosdrm-$(CONFIG_DRM_EXYNOS_HDMI)+= exynos_hdmi.o exynos_mixer.o \
   exynos_ddc.o exynos_hdmiphy.o \
   exynos_drm_hdmi.o
+exynosdrm-$(CONFIG_DRM_EXYNOS_G2D) += exynos_drm_g2d.o
 
 obj-$(CONFIG_DRM_EXYNOS)   += exynosdrm.o
diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c 
b/drivers/gpu/drm/exynos/exynos_drm_drv.c
index b4e265f..2b72c5d 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_drv.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c
@@ -37,6 +37,7 @@
 #include "exynos_drm_fbdev.h"
 #include "exynos_drm_fb.h"
 #include "exynos_drm_gem.h"
+#include "exynos_drm_g2d.h"
 #include "exynos_drm_plane.h"
 
 #define DRIVER_NAME"exynos"
@@ -146,8 +147,16 @@ static int exynos_drm_unload(struct drm_device *dev)
 
 static int exynos_drm_open(struct drm_device *dev, struct drm_file *file)
 {
+   struct drm_exynos_file_private *file_priv;
+
DRM_DEBUG_DRIVER("%s\n", __FILE__);
 
+   file_priv = kzalloc(sizeof(*file_priv), GFP_KERNEL);
+   if (!file_priv)
+   return -ENOMEM;
+
+   file->driver_priv = file_priv;
+
return exynos_drm_subdrv_open(dev, file);
 }
 
@@ -208,6 +217,13 @@ static struct drm_ioctl_desc exynos_ioctls[] = {
exynos_drm_gem_mmap_ioctl, DRM_UNLOCKED | DRM_AUTH),
DRM_IOCTL_DEF_DRV(EXYNOS_PLANE_SET_ZPOS, exynos_plane_set_zpos_ioctl,
DRM_UNLOCKED | DRM_AUTH),
+
+   DRM_IOCTL_DEF_DRV(EXYNOS_G2D_GET_VER,
+   exynos_g2d_get_ver_ioctl, DRM_UNLOCKED | DRM_AUTH),
+   DRM_IOCTL_DEF_DRV(EXYNOS_G2D_SET_CMDLIST,
+   exynos_g2d_set_cmdlist_ioctl, DRM_UNLOCKED | DRM_AUTH),
+   DRM_IOCTL_DEF_DRV(EXYNOS_G2D_EXEC,
+   exynos_g2d_exec_ioctl, DRM_UNLOCKED | DRM_AUTH),
 };
 
 static const struct file_operations exynos_drm_driver_fops = {
@@ -298,6 +314,12 @@ static int __init exynos_drm_init(void)
goto out_common_hdmi;
 #endif
 
+#ifdef CONFIG_DRM_EXYNOS_G2D
+   ret = platform_driver_register(&g2d_driver);
+   if (ret < 0)
+   goto out_g2d;
+#endif
+
ret = platform_driver_register(&exynos_drm_platform_driver);
if (ret < 0)
goto out;
@@ -305,6 +327,11 @@ static int __init exynos_drm_init(void)
return 0;
 
 out:
+#ifdef CONFIG_DRM_EXYNOS_G2D
+   platform_driver_unregister(&g2d_driver);
+out_g2d:
+#endif
+
 #ifdef CONFIG_DRM_EXYNOS_HDMI
platform_driver_unregister(&exynos_drm_common_hdmi_driver);
 out_common_hdmi:
@@ -327,6 +354,10 @@ static void __exit exynos_drm_exit(void)
 
platform_driver_unregister(&exynos_drm_platform_driver);
 
+#ifdef CONFIG_DRM_EXYNOS_G2D
+   platform_driver_unregister(&g2d_driver);
+#endif
+
 #ifdef CONFIG_DRM_EXYNOS_HDMI
platform_driver_unregister(&exynos_drm_common_hdmi_driver);
platform_driver_unregister(&mixer_driver);
diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h 
b/drivers/gpu/drm/exynos/exynos_drm_drv.h
index b26c2f4..750daa9 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_drv.h
+++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h
@@ -203,6 +203,18 @@ struct exynos_drm_manager {
struct exynos_drm_

[PATCH 09/10] drm/exynos: add G2D driver

2012-03-13 Thread Inki Dae
From: Joonyoung Shim 

G2D is a 2D graphic accelerator that supports Bit Block Transfer. This
G2D driver is exynos drm specific and supports only exynos4x12 series.
user application fills command set in cmdlist and once dma start request
these cmdlists are parsed and performed by dma.

This adds below three exynos specific ioctl and one event for G2D.
 - DRM_EXYNOS_G2D_GET_VER
 - DRM_EXYNOS_G2D_SET_CMDLIST
 - DRM_EXYNOS_G2D_EXEC
 - DRM_EXYNOS_G2D_EVENT

Signed-off-by: Joonyoung Shim 
Signed-off-by: Inki Dae 
Signed-off-by: Kyungmin Park 
---
 drivers/gpu/drm/exynos/Kconfig  |6 +
 drivers/gpu/drm/exynos/Makefile |1 +
 drivers/gpu/drm/exynos/exynos_drm_drv.c |   31 ++
 drivers/gpu/drm/exynos/exynos_drm_drv.h |   11 +
 drivers/gpu/drm/exynos/exynos_drm_g2d.c |  864 +++
 drivers/gpu/drm/exynos/exynos_drm_g2d.h |   36 ++
 include/drm/exynos_drm.h|   56 ++
 7 files changed, 1005 insertions(+), 0 deletions(-)
 create mode 100644 drivers/gpu/drm/exynos/exynos_drm_g2d.c
 create mode 100644 drivers/gpu/drm/exynos/exynos_drm_g2d.h

diff --git a/drivers/gpu/drm/exynos/Kconfig b/drivers/gpu/drm/exynos/Kconfig
index 9a9850a..8493fe9 100644
--- a/drivers/gpu/drm/exynos/Kconfig
+++ b/drivers/gpu/drm/exynos/Kconfig
@@ -21,3 +21,9 @@ config DRM_EXYNOS_HDMI
depends on DRM_EXYNOS && !VIDEO_SAMSUNG_S5P_TV
help
  Choose this option if you want to use Exynos HDMI for DRM.
+
+config DRM_EXYNOS_G2D
+   bool "Exynos DRM G2D"
+   depends on DRM_EXYNOS
+   help
+ Choose this option if you want to use Exynos G2D for DRM.
diff --git a/drivers/gpu/drm/exynos/Makefile b/drivers/gpu/drm/exynos/Makefile
index 5331fa3..d6c1a3c 100644
--- a/drivers/gpu/drm/exynos/Makefile
+++ b/drivers/gpu/drm/exynos/Makefile
@@ -12,5 +12,6 @@ exynosdrm-$(CONFIG_DRM_EXYNOS_FIMD)   += exynos_drm_fimd.o
 exynosdrm-$(CONFIG_DRM_EXYNOS_HDMI)+= exynos_hdmi.o exynos_mixer.o \
   exynos_ddc.o exynos_hdmiphy.o \
   exynos_drm_hdmi.o
+exynosdrm-$(CONFIG_DRM_EXYNOS_G2D) += exynos_drm_g2d.o
 
 obj-$(CONFIG_DRM_EXYNOS)   += exynosdrm.o
diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c 
b/drivers/gpu/drm/exynos/exynos_drm_drv.c
index b4e265f..2b72c5d 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_drv.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c
@@ -37,6 +37,7 @@
 #include "exynos_drm_fbdev.h"
 #include "exynos_drm_fb.h"
 #include "exynos_drm_gem.h"
+#include "exynos_drm_g2d.h"
 #include "exynos_drm_plane.h"
 
 #define DRIVER_NAME"exynos"
@@ -146,8 +147,16 @@ static int exynos_drm_unload(struct drm_device *dev)
 
 static int exynos_drm_open(struct drm_device *dev, struct drm_file *file)
 {
+   struct drm_exynos_file_private *file_priv;
+
DRM_DEBUG_DRIVER("%s\n", __FILE__);
 
+   file_priv = kzalloc(sizeof(*file_priv), GFP_KERNEL);
+   if (!file_priv)
+   return -ENOMEM;
+
+   file->driver_priv = file_priv;
+
return exynos_drm_subdrv_open(dev, file);
 }
 
@@ -208,6 +217,13 @@ static struct drm_ioctl_desc exynos_ioctls[] = {
exynos_drm_gem_mmap_ioctl, DRM_UNLOCKED | DRM_AUTH),
DRM_IOCTL_DEF_DRV(EXYNOS_PLANE_SET_ZPOS, exynos_plane_set_zpos_ioctl,
DRM_UNLOCKED | DRM_AUTH),
+
+   DRM_IOCTL_DEF_DRV(EXYNOS_G2D_GET_VER,
+   exynos_g2d_get_ver_ioctl, DRM_UNLOCKED | DRM_AUTH),
+   DRM_IOCTL_DEF_DRV(EXYNOS_G2D_SET_CMDLIST,
+   exynos_g2d_set_cmdlist_ioctl, DRM_UNLOCKED | DRM_AUTH),
+   DRM_IOCTL_DEF_DRV(EXYNOS_G2D_EXEC,
+   exynos_g2d_exec_ioctl, DRM_UNLOCKED | DRM_AUTH),
 };
 
 static const struct file_operations exynos_drm_driver_fops = {
@@ -298,6 +314,12 @@ static int __init exynos_drm_init(void)
goto out_common_hdmi;
 #endif
 
+#ifdef CONFIG_DRM_EXYNOS_G2D
+   ret = platform_driver_register(&g2d_driver);
+   if (ret < 0)
+   goto out_g2d;
+#endif
+
ret = platform_driver_register(&exynos_drm_platform_driver);
if (ret < 0)
goto out;
@@ -305,6 +327,11 @@ static int __init exynos_drm_init(void)
return 0;
 
 out:
+#ifdef CONFIG_DRM_EXYNOS_G2D
+   platform_driver_unregister(&g2d_driver);
+out_g2d:
+#endif
+
 #ifdef CONFIG_DRM_EXYNOS_HDMI
platform_driver_unregister(&exynos_drm_common_hdmi_driver);
 out_common_hdmi:
@@ -327,6 +354,10 @@ static void __exit exynos_drm_exit(void)
 
platform_driver_unregister(&exynos_drm_platform_driver);
 
+#ifdef CONFIG_DRM_EXYNOS_G2D
+   platform_driver_unregister(&g2d_driver);
+#endif
+
 #ifdef CONFIG_DRM_EXYNOS_HDMI
platform_driver_unregister(&exynos_drm_common_hdmi_driver);
platform_driver_unregister(&mixer_driver);
diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h 
b/drivers/gpu/drm/exynos/exynos_drm_drv.h
index b26c2f4..d7b50e5 100644
--- a/driv