From: Sandy Huang <hjc@rock-chips.com>
To: dri-devel@lists.freedesktop.org,
"Dave Airlie" <airlied@redhat.com>,
"Gerd Hoffmann" <kraxel@redhat.com>,
"David Airlie" <airlied@linux.ie>,
"Daniel Vetter" <daniel@ffwll.ch>,
"Noralf Trønnes" <noralf@tronnes.org>,
"Sam Ravnborg" <sam@ravnborg.org>,
"Sandy Huang" <hjc@rock-chips.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
Eric Anholt <eric@anholt.net>,
virtualization@lists.linux-foundation.org,
linux-kernel@vger.kernel.org
Subject: [PATCH 23/36] drm/cirrus: use bpp instead of cpp for drm_format_info
Date: Mon, 23 Sep 2019 20:51:46 +0800 [thread overview]
Message-ID: <1569243119-183293-3-git-send-email-hjc@rock-chips.com> (raw)
In-Reply-To: <1569243119-183293-1-git-send-email-hjc@rock-chips.com>
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
next prev parent reply other threads:[~2019-09-23 12:52 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-23 12:51 [PATCH 21/36] drm/vc4: " Sandy Huang
2019-09-23 12:51 ` [PATCH 22/36] drm/atmel-hlcdc: " Sandy Huang
2019-09-23 17:31 ` Sam Ravnborg
2019-09-23 12:51 ` Sandy Huang [this message]
2019-09-23 12:51 ` [PATCH 24/36] drm/hisilicon: " Sandy Huang
2019-09-23 12:51 ` [PATCH 25/36] drm/imx: " Sandy Huang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1569243119-183293-3-git-send-email-hjc@rock-chips.com \
--to=hjc@rock-chips.com \
--cc=airlied@linux.ie \
--cc=airlied@redhat.com \
--cc=daniel.vetter@ffwll.ch \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=eric@anholt.net \
--cc=kraxel@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=noralf@tronnes.org \
--cc=sam@ravnborg.org \
--cc=virtualization@lists.linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®