linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 16/36] drm/tilcdc: use bpp instead of cpp for drm_format_info
@ 2019-09-23 12:49 Sandy Huang
  2019-09-23 12:49 ` [PATCH 17/36] drm/zte: " Sandy Huang
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Sandy Huang @ 2019-09-23 12:49 UTC (permalink / raw)
  To: dri-devel, Jyri Sarha, David Airlie, Daniel Vetter
  Cc: hjc, Tomi Valkeinen, linux-kernel

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/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




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

* [PATCH 17/36] drm/zte: use bpp instead of cpp for drm_format_info
  2019-09-23 12:49 [PATCH 16/36] drm/tilcdc: use bpp instead of cpp for drm_format_info Sandy Huang
@ 2019-09-23 12:49 ` Sandy Huang
  2019-09-23 12:49 ` [PATCH 18/36] drm/xen: " Sandy Huang
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Sandy Huang @ 2019-09-23 12:49 UTC (permalink / raw)
  To: dri-devel, Shawn Guo, David Airlie, Daniel Vetter; +Cc: hjc, linux-kernel

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/zte/zx_plane.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/zte/zx_plane.c b/drivers/gpu/drm/zte/zx_plane.c
index 086c50f..c265dd3 100644
--- a/drivers/gpu/drm/zte/zx_plane.c
+++ b/drivers/gpu/drm/zte/zx_plane.c
@@ -218,7 +218,7 @@ static void zx_vl_plane_atomic_update(struct drm_plane *plane,
 		cma_obj = drm_fb_cma_get_gem_obj(fb, i);
 		paddr = cma_obj->paddr + fb->offsets[i];
 		paddr += src_y * fb->pitches[i];
-		paddr += src_x * fb->format->cpp[i];
+		paddr += src_x * fb->format->bpp[i] / 8;
 		zx_writel(paddr_reg, paddr);
 		paddr_reg += 4;
 	}
@@ -379,7 +379,7 @@ static void zx_gl_plane_atomic_update(struct drm_plane *plane,
 	dst_w = plane->state->crtc_w;
 	dst_h = plane->state->crtc_h;
 
-	bpp = fb->format->cpp[0];
+	bpp = fb->format->bpp[0] / 8;
 
 	cma_obj = drm_fb_cma_get_gem_obj(fb, 0);
 	paddr = cma_obj->paddr + fb->offsets[0];
-- 
2.7.4




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

* [PATCH 18/36] drm/xen: use bpp instead of cpp for drm_format_info
  2019-09-23 12:49 [PATCH 16/36] drm/tilcdc: use bpp instead of cpp for drm_format_info Sandy Huang
  2019-09-23 12:49 ` [PATCH 17/36] drm/zte: " Sandy Huang
@ 2019-09-23 12:49 ` Sandy Huang
  2019-09-23 12:49 ` [PATCH 19/36] drm/vkms: " Sandy Huang
  2019-09-23 12:49 ` [PATCH 20/36] drm/ast: " Sandy Huang
  3 siblings, 0 replies; 5+ messages in thread
From: Sandy Huang @ 2019-09-23 12:49 UTC (permalink / raw)
  To: dri-devel, Oleksandr Andrushchenko, David Airlie, Daniel Vetter
  Cc: hjc, xen-devel, linux-kernel

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/xen/xen_drm_front_kms.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/xen/xen_drm_front_kms.c b/drivers/gpu/drm/xen/xen_drm_front_kms.c
index 21ad1c3..31de140 100644
--- a/drivers/gpu/drm/xen/xen_drm_front_kms.c
+++ b/drivers/gpu/drm/xen/xen_drm_front_kms.c
@@ -123,7 +123,7 @@ static void display_enable(struct drm_simple_display_pipe *pipe,
 
 	ret = xen_drm_front_mode_set(pipeline, crtc->x, crtc->y,
 				     fb->width, fb->height,
-				     fb->format->cpp[0] * 8,
+				     fb->format->bpp[0],
 				     xen_drm_front_fb_to_cookie(fb));
 
 	if (ret) {
-- 
2.7.4




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

* [PATCH 19/36] drm/vkms: use bpp instead of cpp for drm_format_info
  2019-09-23 12:49 [PATCH 16/36] drm/tilcdc: use bpp instead of cpp for drm_format_info Sandy Huang
  2019-09-23 12:49 ` [PATCH 17/36] drm/zte: " Sandy Huang
  2019-09-23 12:49 ` [PATCH 18/36] drm/xen: " Sandy Huang
@ 2019-09-23 12:49 ` Sandy Huang
  2019-09-23 12:49 ` [PATCH 20/36] drm/ast: " Sandy Huang
  3 siblings, 0 replies; 5+ messages in thread
From: Sandy Huang @ 2019-09-23 12:49 UTC (permalink / raw)
  To: dri-devel, Rodrigo Siqueira, David Airlie, Daniel Vetter
  Cc: hjc, Haneen Mohammed, linux-kernel

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/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




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

* [PATCH 20/36] drm/ast: use bpp instead of cpp for drm_format_info
  2019-09-23 12:49 [PATCH 16/36] drm/tilcdc: use bpp instead of cpp for drm_format_info Sandy Huang
                   ` (2 preceding siblings ...)
  2019-09-23 12:49 ` [PATCH 19/36] drm/vkms: " Sandy Huang
@ 2019-09-23 12:49 ` Sandy Huang
  3 siblings, 0 replies; 5+ messages in thread
From: Sandy Huang @ 2019-09-23 12:49 UTC (permalink / raw)
  To: dri-devel, Dave Airlie, David Airlie, Daniel Vetter,
	Thomas Zimmermann, Gerd Hoffmann, Sam Ravnborg, Y.C. Chen,
	Sandy Huang, José Roberto de Souza
  Cc: Daniel Vetter, linux-kernel

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/ast/ast_mode.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c
index c191e8e..439d0b3 100644
--- a/drivers/gpu/drm/ast/ast_mode.c
+++ b/drivers/gpu/drm/ast/ast_mode.c
@@ -93,7 +93,7 @@ static bool ast_get_vbios_mode_info(struct drm_crtc *crtc, struct drm_display_mo
 	u32 hborder, vborder;
 	bool check_sync;
 
-	switch (fb->format->cpp[0] * 8) {
+	switch (fb->format->bpp[0]) {
 	case 8:
 		vbios_mode->std_table = &vbios_stdtable[VGAModeIndex];
 		color_index = VGAModeIndex - 1;
@@ -217,7 +217,7 @@ static bool ast_get_vbios_mode_info(struct drm_crtc *crtc, struct drm_display_mo
 		if (vbios_mode->enh_table->flags & NewModeInfo) {
 			ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0x91, 0xa8);
 			ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0x92,
-					  fb->format->cpp[0] * 8);
+					  fb->format->bpp[0]);
 			ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0x93, adjusted_mode->clock / 1000);
 			ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0x94, adjusted_mode->crtc_hdisplay);
 			ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0x95, adjusted_mode->crtc_hdisplay >> 8);
@@ -422,7 +422,7 @@ static void ast_set_ext_reg(struct drm_crtc *crtc, struct drm_display_mode *mode
 	const struct drm_framebuffer *fb = crtc->primary->fb;
 	u8 jregA0 = 0, jregA3 = 0, jregA8 = 0;
 
-	switch (fb->format->cpp[0] * 8) {
+	switch (fb->format->bpp[0]) {
 	case 8:
 		jregA0 = 0x70;
 		jregA3 = 0x01;
@@ -480,7 +480,7 @@ static bool ast_set_dac_reg(struct drm_crtc *crtc, struct drm_display_mode *mode
 {
 	const struct drm_framebuffer *fb = crtc->primary->fb;
 
-	switch (fb->format->cpp[0] * 8) {
+	switch (fb->format->bpp[0]) {
 	case 8:
 		break;
 	default:
-- 
2.7.4




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

end of thread, other threads:[~2019-09-23 12:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-23 12:49 [PATCH 16/36] drm/tilcdc: use bpp instead of cpp for drm_format_info Sandy Huang
2019-09-23 12:49 ` [PATCH 17/36] drm/zte: " Sandy Huang
2019-09-23 12:49 ` [PATCH 18/36] drm/xen: " Sandy Huang
2019-09-23 12:49 ` [PATCH 19/36] drm/vkms: " Sandy Huang
2019-09-23 12:49 ` [PATCH 20/36] drm/ast: " Sandy Huang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).