Skip to contentSkip to conversation

drm/tilcdc: use bpp instead of cpp for drm_format_info

PATCH In review Sandy Huang 1 participant 5 messages Sep 23, 2019

Subsystems (6)
lore
Share & tools
lore
#0 lore raw

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.

---
 drivers/gpu/drm/tilcdc/tilcdc_crtc.c  | 2 +-
 drivers/gpu/drm/tilcdc/tilcdc_plane.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/tilcdc/tilcdc_crtc.c +1 -1
index e9dd5e5..78c587d 100644
@@ -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]);
 
drivers/gpu/drm/tilcdc/tilcdc_plane.c +1 -1
index 3abb964..fca7375 100644
@@ -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");
Signature · 8 lines
2.7.4



_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw

PATCH 17/36 drm/zte: 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.

---
 drivers/gpu/drm/zte/zx_plane.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/zte/zx_plane.c +2 -2
index 086c50f..c265dd3 100644
@@ -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];
Signature · 1 line
2.7.4
#2 lore raw

PATCH 18/36 drm/xen: use bpp instead of cpp for drm_format_info

In reply to Sandy Huang

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

---
 drivers/gpu/drm/xen/xen_drm_front_kms.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/xen/xen_drm_front_kms.c +1 -1
index 21ad1c3..31de140 100644
@@ -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) {
Signature · 8 lines
2.7.4



_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#3 lore raw

PATCH 19/36 drm/vkms: use bpp instead of cpp for drm_format_info

In reply to Sandy Huang

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

---
 drivers/gpu/drm/vkms/vkms_plane.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/vkms/vkms_plane.c +1 -1
index 5fc8f85..c2b0057 100644
@@ -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,
Signature · 8 lines
2.7.4



_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#4 lore raw

PATCH 20/36 drm/ast: use bpp instead of cpp for drm_format_info

In reply to Sandy Huang

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

---
 drivers/gpu/drm/ast/ast_mode.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/ast/ast_mode.c +4 -4
index c191e8e..439d0b3 100644
@@ -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:
Signature · 1 line
2.7.4