2019-09-25 12:49:06

by Sandy Huang

[permalink] [raw]
Subject: [PATCH 16/36] drm/tilcdc: use bpp instead of cpp for drm_format_info

cpp[BytePerPlane] can't describe the 10bit data format correctly,
So we use bpp[BitPerPlane] to instead cpp.

Signed-off-by: Sandy Huang <[email protected]>
---
drivers/gpu/drm/tilcdc/tilcdc_crtc.c | 2 +-
drivers/gpu/drm/tilcdc/tilcdc_plane.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
index e9dd5e5..78c587d 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
@@ -71,7 +71,7 @@ static void set_scanout(struct drm_crtc *crtc, struct drm_framebuffer *fb)

start = gem->paddr + fb->offsets[0] +
crtc->y * fb->pitches[0] +
- crtc->x * fb->format->cpp[0];
+ crtc->x * fb->format->bpp[0] / 8;

end = start + (crtc->mode.vdisplay * fb->pitches[0]);

diff --git a/drivers/gpu/drm/tilcdc/tilcdc_plane.c b/drivers/gpu/drm/tilcdc/tilcdc_plane.c
index 3abb964..fca7375 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_plane.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_plane.c
@@ -55,7 +55,7 @@ static int tilcdc_plane_atomic_check(struct drm_plane *plane,
}

pitch = crtc_state->mode.hdisplay *
- state->fb->format->cpp[0];
+ state->fb->format->bpp[0] / 8;
if (state->fb->pitches[0] != pitch) {
dev_err(plane->dev->dev,
"Invalid pitch: fb and crtc widths must be the same");
--
2.7.4




2019-09-25 13:02:45

by Sandy Huang

[permalink] [raw]
Subject: [PATCH 19/36] drm/vkms: use bpp instead of cpp for drm_format_info

cpp[BytePerPlane] can't describe the 10bit data format correctly,
So we use bpp[BitPerPlane] to instead cpp.

Signed-off-by: Sandy Huang <[email protected]>
---
drivers/gpu/drm/vkms/vkms_plane.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/vkms/vkms_plane.c b/drivers/gpu/drm/vkms/vkms_plane.c
index 5fc8f85..c2b0057 100644
--- a/drivers/gpu/drm/vkms/vkms_plane.c
+++ b/drivers/gpu/drm/vkms/vkms_plane.c
@@ -107,7 +107,7 @@ static void vkms_plane_atomic_update(struct drm_plane *plane,
drm_framebuffer_get(&composer->fb);
composer->offset = fb->offsets[0];
composer->pitch = fb->pitches[0];
- composer->cpp = fb->format->cpp[0];
+ composer->cpp = fb->format->bpp[0] / 8;
}

static int vkms_plane_atomic_check(struct drm_plane *plane,
--
2.7.4