All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] update pixel format setting to fimd driver
@ 2013-08-20  5:45 Inki Dae
  2013-08-20  5:45 ` [PATCH 1/2] drm/exynos: fix fimd pixel format setting Inki Dae
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Inki Dae @ 2013-08-20  5:45 UTC (permalink / raw)
  To: airlied, dri-devel; +Cc: kyungmin.park, sw0312.kim

This patch series fix pixel format setting according to
drm_framebuffer's pixel_format, and check if a given window
supports alpha channel or not.

Inki Dae (2):
  drm/exynos: fix fimd pixel format setting
  drm/exynos: check a pixel format to a particular window layer

 drivers/gpu/drm/exynos/exynos_drm_fimd.c |   45 ++++++++++++++++--------------
 1 files changed, 24 insertions(+), 21 deletions(-)

-- 
1.7.5.4

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] drm/exynos: fix fimd pixel format setting
  2013-08-20  5:45 [PATCH 0/2] update pixel format setting to fimd driver Inki Dae
@ 2013-08-20  5:45 ` Inki Dae
  2013-08-20  5:45 ` [PATCH 2/2] drm/exynos: check a pixel format to a particular window layer Inki Dae
  2013-08-20 23:32 ` [PATCH 0/2] update pixel format setting to fimd driver Tomasz Figa
  2 siblings, 0 replies; 4+ messages in thread
From: Inki Dae @ 2013-08-20  5:45 UTC (permalink / raw)
  To: airlied, dri-devel; +Cc: kyungmin.park, sw0312.kim

This patch fixes wrong pixel format setting.

A pixel format is decided according to bpp and depth, or user-requested
format but fimd driver considered only bpp value to decide a proper pixel
format. So this patch makes a proper pixel format to be set according
to drm_framebuffer's pixel_format which is set by addfb with bpp and
depth, or addfb2 with user-requested format.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
 drivers/gpu/drm/exynos/exynos_drm_fimd.c |   34 +++++++++++------------------
 1 files changed, 13 insertions(+), 21 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index b8aa8fe..13d5afb 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -91,6 +91,7 @@ struct fimd_win_data {
 	unsigned int		fb_width;
 	unsigned int		fb_height;
 	unsigned int		bpp;
+	unsigned int		pixel_format;
 	dma_addr_t		dma_addr;
 	unsigned int		buf_offsize;
 	unsigned int		line_size;	/* bytes */
@@ -397,6 +398,7 @@ static void fimd_win_mode_set(struct device *dev,
 	win_data->fb_height = overlay->fb_height;
 	win_data->dma_addr = overlay->dma_addr[0] + offset;
 	win_data->bpp = overlay->bpp;
+	win_data->pixel_format = overlay->pixel_format;
 	win_data->buf_offsize = (overlay->fb_width - overlay->crtc_width) *
 				(overlay->bpp >> 3);
 	win_data->line_size = overlay->crtc_width * (overlay->bpp >> 3);
@@ -418,39 +420,29 @@ static void fimd_win_set_pixfmt(struct device *dev, unsigned int win)
 
 	val = WINCONx_ENWIN;
 
-	switch (win_data->bpp) {
-	case 1:
-		val |= WINCON0_BPPMODE_1BPP;
-		val |= WINCONx_BITSWP;
-		val |= WINCONx_BURSTLEN_4WORD;
-		break;
-	case 2:
-		val |= WINCON0_BPPMODE_2BPP;
-		val |= WINCONx_BITSWP;
-		val |= WINCONx_BURSTLEN_8WORD;
-		break;
-	case 4:
-		val |= WINCON0_BPPMODE_4BPP;
-		val |= WINCONx_BITSWP;
-		val |= WINCONx_BURSTLEN_8WORD;
-		break;
-	case 8:
+	switch (win_data->pixel_format) {
+	case DRM_FORMAT_C8:
 		val |= WINCON0_BPPMODE_8BPP_PALETTE;
 		val |= WINCONx_BURSTLEN_8WORD;
 		val |= WINCONx_BYTSWP;
 		break;
-	case 16:
+	case DRM_FORMAT_XRGB1555:
+		val |= WINCON0_BPPMODE_16BPP_1555;
+		val |= WINCONx_HAWSWP;
+		val |= WINCONx_BURSTLEN_16WORD;
+		break;
+	case DRM_FORMAT_RGB565:
 		val |= WINCON0_BPPMODE_16BPP_565;
 		val |= WINCONx_HAWSWP;
 		val |= WINCONx_BURSTLEN_16WORD;
 		break;
-	case 24:
+	case DRM_FORMAT_XRGB8888:
 		val |= WINCON0_BPPMODE_24BPP_888;
 		val |= WINCONx_WSWP;
 		val |= WINCONx_BURSTLEN_16WORD;
 		break;
-	case 32:
-		val |= WINCON1_BPPMODE_28BPP_A4888
+	case DRM_FORMAT_ARGB8888:
+		val |= WINCON1_BPPMODE_25BPP_A1888
 			| WINCON1_BLD_PIX | WINCON1_ALPHA_SEL;
 		val |= WINCONx_WSWP;
 		val |= WINCONx_BURSTLEN_16WORD;
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] drm/exynos: check a pixel format to a particular window layer
  2013-08-20  5:45 [PATCH 0/2] update pixel format setting to fimd driver Inki Dae
  2013-08-20  5:45 ` [PATCH 1/2] drm/exynos: fix fimd pixel format setting Inki Dae
@ 2013-08-20  5:45 ` Inki Dae
  2013-08-20 23:32 ` [PATCH 0/2] update pixel format setting to fimd driver Tomasz Figa
  2 siblings, 0 replies; 4+ messages in thread
From: Inki Dae @ 2013-08-20  5:45 UTC (permalink / raw)
  To: airlied, dri-devel; +Cc: kyungmin.park, sw0312.kim

This patch checks if a requested window supports alpha channel or not.

In case of s3c64xx, window 0 doesn't support alpha channel so if
the request pixel format is ARGB8888 then change it to XRGB8888.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
 drivers/gpu/drm/exynos/exynos_drm_fimd.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index 13d5afb..f8889d2 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -66,11 +66,13 @@ struct fimd_driver_data {
 
 	unsigned int has_shadowcon:1;
 	unsigned int has_clksel:1;
+	unsigned int has_limited_fmt:1;
 };
 
 static struct fimd_driver_data s3c64xx_fimd_driver_data = {
 	.timing_base = 0x0,
 	.has_clksel = 1,
+	.has_limited_fmt = 1,
 };
 
 static struct fimd_driver_data exynos4_fimd_driver_data = {
@@ -420,6 +422,15 @@ static void fimd_win_set_pixfmt(struct device *dev, unsigned int win)
 
 	val = WINCONx_ENWIN;
 
+	/*
+	 * In case of s3c64xx, window 0 doesn't support alpha channel.
+	 * So the request format is ARGB8888 then change it to XRGB8888.
+	 */
+	if (ctx->driver_data->has_limited_fmt && !win) {
+		if (win_data->pixel_format == DRM_FORMAT_ARGB8888)
+			win_data->pixel_format = DRM_FORMAT_XRGB8888;
+	}
+
 	switch (win_data->pixel_format) {
 	case DRM_FORMAT_C8:
 		val |= WINCON0_BPPMODE_8BPP_PALETTE;
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 0/2] update pixel format setting to fimd driver
  2013-08-20  5:45 [PATCH 0/2] update pixel format setting to fimd driver Inki Dae
  2013-08-20  5:45 ` [PATCH 1/2] drm/exynos: fix fimd pixel format setting Inki Dae
  2013-08-20  5:45 ` [PATCH 2/2] drm/exynos: check a pixel format to a particular window layer Inki Dae
@ 2013-08-20 23:32 ` Tomasz Figa
  2 siblings, 0 replies; 4+ messages in thread
From: Tomasz Figa @ 2013-08-20 23:32 UTC (permalink / raw)
  To: dri-devel; +Cc: kyungmin.park, sw0312.kim

Hi Inki,

On Tuesday 20 of August 2013 14:45:10 Inki Dae wrote:
> This patch series fix pixel format setting according to
> drm_framebuffer's pixel_format, and check if a given window
> supports alpha channel or not.
> 
> Inki Dae (2):
>   drm/exynos: fix fimd pixel format setting
>   drm/exynos: check a pixel format to a particular window layer
> 
>  drivers/gpu/drm/exynos/exynos_drm_fimd.c |   45
> ++++++++++++++++-------------- 1 files changed, 24 insertions(+), 21
> deletions(-)

For the whole series:

Reviewed-by: Tomasz Figa <t.figa@samsung.com>

Best regards,
Tomasz

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-08-20 23:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-20  5:45 [PATCH 0/2] update pixel format setting to fimd driver Inki Dae
2013-08-20  5:45 ` [PATCH 1/2] drm/exynos: fix fimd pixel format setting Inki Dae
2013-08-20  5:45 ` [PATCH 2/2] drm/exynos: check a pixel format to a particular window layer Inki Dae
2013-08-20 23:32 ` [PATCH 0/2] update pixel format setting to fimd driver Tomasz Figa

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.