Skip to contentSkip to conversation

drm/vboxvideo: use bpp instead of cpp for drm_format_info

PATCH In review Sandy Huang 2 participants 6 messages Sep 23, 2019 – Sep 25, 2019

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

PATCH 26/36 drm/vboxvideo: 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/vboxvideo/vbox_mode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/vboxvideo/vbox_mode.c +1 -1
index e1e48ba..838120b 100644
@@ -38,7 +38,7 @@ static void vbox_do_modeset(struct drm_crtc *crtc)
 	vbox = crtc->dev->dev_private;
 	width = vbox_crtc->width ? vbox_crtc->width : 640;
 	height = vbox_crtc->height ? vbox_crtc->height : 480;
-	bpp = fb ? fb->format->cpp[0] * 8 : 32;
+	bpp = fb ? fb->format->bpp[0] : 32;
 	pitch = fb ? fb->pitches[0] : width * bpp / 8;
 	x_offset = vbox->single_framebuffer ? vbox_crtc->x : vbox_crtc->x_hint;
 	y_offset = vbox->single_framebuffer ? vbox_crtc->y : vbox_crtc->y_hint;
Signature · 1 line
2.7.4
#1 lore raw

PATCH 27/36 drm/pl111: 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/pl111/pl111_display.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/pl111/pl111_display.c +1 -1
index 024771a4..9bc1664 100644
@@ -103,7 +103,7 @@ static int pl111_display_check(struct drm_simple_display_pipe *pipe,
 		/* There's no pitch register -- the mode's hdisplay
 		 * controls it.
 		 */
-		if (fb->pitches[0] != mode->hdisplay * fb->format->cpp[0])
+		if (fb->pitches[0] != mode->hdisplay * fb->format->bpp[0] / 8)
 			return -EINVAL;
 
 		/* We can't change the FB format in a flicker-free
Signature · 1 line
2.7.4
#2 lore raw

PATCH 28/36 drm/qxl: 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/qxl/qxl_draw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/qxl/qxl_draw.c +1 -1
index 5bebf1e..71c18e6 100644
@@ -141,7 +141,7 @@ void qxl_draw_dirty_fb(struct qxl_device *qdev,
 	struct qxl_rect *rects;
 	int stride = fb->pitches[0];
 	/* depth is not actually interesting, we don't mask with it */
-	int depth = fb->format->cpp[0] * 8;
+	int depth = fb->format->bpp[0];
 	uint8_t *surface_base;
 	struct qxl_release *release;
 	struct qxl_bo *clips_bo;
Signature · 1 line
2.7.4
#3 lore raw

PATCH 29/36 drm/ingenic: 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/ingenic/ingenic-drm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/ingenic/ingenic-drm.c +1 -1
index ec32e1c..70ccec5 100644
@@ -375,7 +375,7 @@ static void ingenic_drm_plane_atomic_update(struct drm_plane *plane,
 
 	width = state->crtc->state->adjusted_mode.hdisplay;
 	height = state->crtc->state->adjusted_mode.vdisplay;
-	cpp = state->fb->format->cpp[plane->index];
+	cpp = state->fb->format->bpp[plane->index] / 8;
 
 	priv->dma_hwdesc->addr = drm_fb_cma_get_gem_addr(state->fb, state, 0);
 	priv->dma_hwdesc->cmd = width * height * cpp / 4;
Signature · 8 lines
2.7.4



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

Re: [PATCH 29/36] drm/ingenic: use bpp instead of cpp for drm_format_info

Hi Sandy,

Quoted 13 lines · Sandy Huang

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

---
 drivers/gpu/drm/ingenic/ingenic-drm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/ingenic/ingenic-drm.c +0 -0
index ec32e1c..70ccec5 100644

drivers/gpu/drm/ingenic/ingenic-drm.c static void · line 379

Quoted 6 lines
drivers/gpu/drm/ingenic/ingenic-drm.c +1 -1
@@ -375,7 +375,7 @@ static void 
 ingenic_drm_plane_atomic_update(struct drm_plane *plane,
 
 	width = state->crtc->state->adjusted_mode.hdisplay;
 	height = state->crtc->state->adjusted_mode.vdisplay;
-	cpp = state->fb->format->cpp[plane->index];
+	cpp = state->fb->format->bpp[plane->index] / 8;

That wouldn't work with 15-bit rgb555...

Quoted 9 lines
drivers/gpu/drm/ingenic/ingenic-drm.c +0 -0
 	priv->dma_hwdesc->addr = drm_fb_cma_get_gem_addr(state->fb, state, 
 0);

priv->dma_hwdesc->cmd = width * height * cpp / 4;
--
2.7.4

#5 lore raw

PATCH 30/36 drm/sti: 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/sti/sti_gdp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/sti/sti_gdp.c +1 -1
index 11595c7..9280271 100644
@@ -775,7 +775,7 @@ static void sti_gdp_atomic_update(struct drm_plane *drm_plane,
 			 (unsigned long)cma_obj->paddr);
 
 	/* pixel memory location */
-	bpp = fb->format->cpp[0];
+	bpp = fb->format->bpp[0] / 8;
 	top_field->gam_gdp_pml = (u32)cma_obj->paddr + fb->offsets[0];
 	top_field->gam_gdp_pml += src_x * bpp;
 	top_field->gam_gdp_pml += src_y * fb->pitches[0];
Signature · 8 lines
2.7.4



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