lkml.org 
[lkml]   [2019]   [Sep]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 23/36] drm/cirrus: use bpp instead of cpp for drm_format_info
Date
cpp[BytePerPlane] can't describe the 10bit data format correctly,
So we use bpp[BitPerPlane] to instead cpp.

Signed-off-by: Sandy Huang <hjc@rock-chips.com>
---
drivers/gpu/drm/cirrus/cirrus.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/cirrus/cirrus.c b/drivers/gpu/drm/cirrus/cirrus.c
index 89d9e6f..ba47fdf 100644
--- a/drivers/gpu/drm/cirrus/cirrus.c
+++ b/drivers/gpu/drm/cirrus/cirrus.c
@@ -121,7 +121,7 @@ static void wreg_hdr(struct cirrus_device *cirrus, u8 val)

static int cirrus_convert_to(struct drm_framebuffer *fb)
{
- if (fb->format->cpp[0] == 4 && fb->pitches[0] > CIRRUS_MAX_PITCH) {
+ if (fb->format->bpp[0] == 32 && fb->pitches[0] > CIRRUS_MAX_PITCH) {
if (fb->width * 3 <= CIRRUS_MAX_PITCH)
/* convert from XR24 to RG24 */
return 3;
@@ -138,7 +138,7 @@ static int cirrus_cpp(struct drm_framebuffer *fb)

if (convert_cpp)
return convert_cpp;
- return fb->format->cpp[0];
+ return fb->format->bpp[0] / 8;
}

static int cirrus_pitch(struct drm_framebuffer *fb)
@@ -306,16 +306,16 @@ static int cirrus_fb_blit_rect(struct drm_framebuffer *fb,
if (!vmap)
return -ENOMEM;

- if (cirrus->cpp == fb->format->cpp[0])
+ if (cirrus->cpp == fb->format->bpp[0] / 8)
drm_fb_memcpy_dstclip(cirrus->vram,
vmap, fb, rect);

- else if (fb->format->cpp[0] == 4 && cirrus->cpp == 2)
+ else if (fb->format->bpp[0] == 32 && cirrus->cpp == 2)
drm_fb_xrgb8888_to_rgb565_dstclip(cirrus->vram,
cirrus->pitch,
vmap, fb, rect, false);

- else if (fb->format->cpp[0] == 4 && cirrus->cpp == 3)
+ else if (fb->format->bpp[0] == 32 && cirrus->cpp == 3)
drm_fb_xrgb8888_to_rgb888_dstclip(cirrus->vram,
cirrus->pitch,
vmap, fb, rect);
--
2.7.4


\
 
 \ /
  Last update: 2019-09-23 14:52    [W:0.120 / U:0.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site