@@ -91,7 +91,7 @@ static int vmw_fb_setcolreg(unsigned regno, unsigned red, unsigned green,
default:
DRM_ERROR("Bad depth %u, bpp %u.\n",
par->set_fb->format->depth,
- par->set_fb->format->cpp[0] * 8);
+ par->set_fb->format->bpp[0]);
return 1;
}
@@ -211,7 +211,7 @@ static void vmw_fb_dirty_flush(struct work_struct *work)
* Handle panning when copying from vmalloc to framebuffer.
* Clip dirty area to framebuffer.
*/
- cpp = cur_fb->format->cpp[0];
+ cpp = cur_fb->format->bpp[0] / 8;
max_x = par->fb_x + cur_fb->width;
max_y = par->fb_y + cur_fb->height;
@@ -98,7 +98,7 @@ static int vmw_ldu_commit_list(struct vmw_private *dev_priv)
fb = entry->base.crtc.primary->state->fb;
return vmw_kms_write_svga(dev_priv, w, h, fb->pitches[0],
- fb->format->cpp[0] * 8,
+ fb->format->bpp[0],
fb->format->depth);
}
@@ -107,7 +107,7 @@ static int vmw_ldu_commit_list(struct vmw_private *dev_priv)
fb = entry->base.crtc.primary->state->fb;
vmw_kms_write_svga(dev_priv, fb->width, fb->height, fb->pitches[0],
- fb->format->cpp[0] * 8, fb->format->depth);
+ fb->format->bpp[0], fb->format->depth);
}
/* Make sure we always show something. */
@@ -487,7 +487,7 @@ static uint32_t vmw_sou_bo_define_gmrfb(struct vmw_du_update_plane *update,
gmr->header = SVGA_CMD_DEFINE_GMRFB;
- gmr->body.format.bitsPerPixel = update->vfb->base.format->cpp[0] * 8;
+ gmr->body.format.bitsPerPixel = update->vfb->base.format->bpp[0];
gmr->body.format.colorDepth = depth;
gmr->body.format.reserved = 0;
gmr->body.bytesPerLine = update->vfb->base.pitches[0];
@@ -997,7 +997,7 @@ static int do_bo_define_gmrfb(struct vmw_private *dev_priv,
return -ENOMEM;
cmd->header = SVGA_CMD_DEFINE_GMRFB;
- cmd->body.format.bitsPerPixel = framebuffer->base.format->cpp[0] * 8;
+ cmd->body.format.bitsPerPixel = framebuffer->base.format->bpp[0];
cmd->body.format.colorDepth = depth;
cmd->body.format.reserved = 0;
cmd->body.bytesPerLine = framebuffer->base.pitches[0];
@@ -1074,7 +1074,7 @@ vmw_stdu_primary_plane_prepare_fb(struct drm_plane *plane,
*/
if (new_content_type == SEPARATE_BO) {
- switch (new_fb->format->cpp[0]*8) {
+ switch (new_fb->format->bpp[0]) {
case 32:
content_srf.format = SVGA3D_X8R8G8B8;
break;
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/vmwgfx/vmwgfx_fb.c | 4 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c | 4 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c | 4 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-)