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/stm/ltdc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/stm/ltdc.c b/drivers/gpu/drm/stm/ltdc.c index 5b512989..527c735 100644 --- a/drivers/gpu/drm/stm/ltdc.c +++ b/drivers/gpu/drm/stm/ltdc.c @@ -817,7 +817,7 @@ static void ltdc_plane_atomic_update(struct drm_plane *plane,
/* Configures the color frame buffer pitch in bytes & line length */ pitch_in_bytes = fb->pitches[0]; - line_length = fb->format->cpp[0] * + line_length = fb->format->bpp[0] / 8 * (x1 - x0 + 1) + (ldev->caps.bus_width >> 3) - 1; val = ((pitch_in_bytes << 16) | line_length); reg_update_bits(ldev->regs, LTDC_L1CFBLR + lofs,
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/mcde/mcde_display.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/mcde/mcde_display.c b/drivers/gpu/drm/mcde/mcde_display.c index 751454a..da2a3db 100644 --- a/drivers/gpu/drm/mcde/mcde_display.c +++ b/drivers/gpu/drm/mcde/mcde_display.c @@ -168,7 +168,7 @@ static int mcde_display_check(struct drm_simple_display_pipe *pipe, * There's no pitch register, the mode's hdisplay * controls this. */ - if (fb->pitches[0] != mode->hdisplay * fb->format->cpp[0]) { + if (fb->pitches[0] != mode->hdisplay * fb->format->bpp[0] / 8) { DRM_DEBUG_KMS("can't handle pitches\n"); return -EINVAL; } @@ -823,7 +823,7 @@ static void mcde_display_enable(struct drm_simple_display_pipe *pipe, u32 formatter_ppl = mode->hdisplay; /* pixels per line */ u32 formatter_lpf = mode->vdisplay; /* lines per frame */ int pkt_size, fifo_wtrmrk; - int cpp = fb->format->cpp[0]; + int cpp = fb->format->bpp[0] / 8; int formatter_cpp; struct drm_format_name_buf tmp; u32 formatter_frame;
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/mgag200/mgag200_mode.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/gpu/drm/mgag200/mgag200_mode.c b/drivers/gpu/drm/mgag200/mgag200_mode.c index 6822655..5aff652 100644 --- a/drivers/gpu/drm/mgag200/mgag200_mode.c +++ b/drivers/gpu/drm/mgag200/mgag200_mode.c @@ -41,7 +41,7 @@ static void mga_crtc_load_lut(struct drm_crtc *crtc)
WREG8(DAC_INDEX + MGA1064_INDEX, 0);
- if (fb && fb->format->cpp[0] * 8 == 16) { + if (fb && fb->format->bpp[0] == 16) { int inc = (fb->format->depth == 15) ? 8 : 4; u8 r, b; for (i = 0; i < MGAG200_LUT_SIZE; i += inc) { @@ -925,7 +925,7 @@ static int mga_crtc_mode_set(struct drm_crtc *crtc, /* 0x48: */ 0, 0, 0, 0, 0, 0, 0, 0 };
- bppshift = mdev->bpp_shifts[fb->format->cpp[0] - 1]; + bppshift = mdev->bpp_shifts[fb->format->bpp[0] / 8 - 1];
switch (mdev->type) { case G200_SE_A: @@ -965,7 +965,7 @@ static int mga_crtc_mode_set(struct drm_crtc *crtc, break; }
- switch (fb->format->cpp[0] * 8) { + switch (fb->format->bpp[0]) { case 8: dacvalue[MGA1064_MUL_CTL] = MGA1064_MUL_CTL_8bits; break; @@ -1022,8 +1022,8 @@ static int mga_crtc_mode_set(struct drm_crtc *crtc, WREG_SEQ(3, 0); WREG_SEQ(4, 0xe);
- pitch = fb->pitches[0] / fb->format->cpp[0]; - if (fb->format->cpp[0] * 8 == 24) + pitch = fb->pitches[0] / fb->format->bpp[0] / 8; + if (fb->format->bpp[0] == 24) pitch = (pitch * 3) >> (4 - bppshift); else pitch = pitch >> (4 - bppshift); @@ -1100,7 +1100,7 @@ static int mga_crtc_mode_set(struct drm_crtc *crtc, ((vdisplay & 0xc00) >> 7) | ((vsyncstart & 0xc00) >> 5) | ((vdisplay & 0x400) >> 3); - if (fb->format->cpp[0] * 8 == 24) + if (fb->format->bpp[0] == 24) ext_vga[3] = (((1 << bppshift) * 3) - 1) | 0x80; else ext_vga[3] = ((1 << bppshift) - 1) | 0x80; @@ -1166,9 +1166,9 @@ static int mga_crtc_mode_set(struct drm_crtc *crtc, u32 bpp; u32 mb;
- if (fb->format->cpp[0] * 8 > 16) + if (fb->format->bpp[0] > 16) bpp = 32; - else if (fb->format->cpp[0] * 8 > 8) + else if (fb->format->bpp[0] > 8) bpp = 16; else bpp = 8;
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/tve200/tve200_display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/tve200/tve200_display.c b/drivers/gpu/drm/tve200/tve200_display.c index d733bbc..915f3b1 100644 --- a/drivers/gpu/drm/tve200/tve200_display.c +++ b/drivers/gpu/drm/tve200/tve200_display.c @@ -101,7 +101,7 @@ static int tve200_display_check(struct drm_simple_display_pipe *pipe, * There's no pitch register, the mode's hdisplay * controls this. */ - if (fb->pitches[0] != mode->hdisplay * fb->format->cpp[0]) { + if (fb->pitches[0] != mode->hdisplay * fb->format->bpp[0] / 8) { DRM_DEBUG_KMS("can't handle pitches\n"); return -EINVAL; }
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/udl/udl_fb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/udl/udl_fb.c b/drivers/gpu/drm/udl/udl_fb.c index ef3504d..33a42bd 100644 --- a/drivers/gpu/drm/udl/udl_fb.c +++ b/drivers/gpu/drm/udl/udl_fb.c @@ -88,8 +88,8 @@ int udl_handle_damage(struct udl_framebuffer *fb, int x, int y, int aligned_x; int log_bpp;
- BUG_ON(!is_power_of_2(fb->base.format->cpp[0])); - log_bpp = __ffs(fb->base.format->cpp[0]); + BUG_ON(!is_power_of_2(fb->base.format->bpp[0] / 8)); + log_bpp = __ffs(fb->base.format->bpp[0] / 8);
if (!fb->active_16) return 0;
dri-devel@lists.freedesktop.org