drm/amd: use bpp instead of cpp for drm_format_info
Subsystems (10)
PATCH 6/36 drm/amd: 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/amd/amdgpu/amdgpu_fb.c | 2 +- drivers/gpu/drm/amd/amdgpu/dce_v10_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/dce_v11_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/dce_v6_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/dce_v8_0.c | 2 +- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 +++--- 6 files changed, 8 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c +1 -1
@@ -133,7 +133,7 @@ static int amdgpufb_create_pinned_object(struct amdgpu_fbdev *rfbdev,u32 cpp; info =drm_get_format_info (adev->ddev, mode_cmd); - cpp = info->cpp[0 ]; + cpp = info->bpp[0 ] /8 ;/* need to align pitch with crtc limits */ mode_cmd->pitches[0] = amdgpu_align_pitch(adev, mode_cmd->width, cpp,
drivers/gpu/drm/amd/amdgpu/dce_v10_0.c +1 -1
@@ -2034,7 +2034,7 @@ static int dce_v10_0_crtc_do_set_base(struct drm_crtc *crtc,WREG32 (mmGRPH_X_END + amdgpu_crtc->crtc_offset, target_fb->width);WREG32 (mmGRPH_Y_END + amdgpu_crtc->crtc_offset, target_fb->height); - fb_pitch_pixels = target_fb->pitches[0 ] / target_fb->format->cpp[0 ]; + fb_pitch_pixels = target_fb->pitches[0 ] / target_fb->format->bpp[0 ] /8 ;WREG32 (mmGRPH_PITCH + amdgpu_crtc->crtc_offset, fb_pitch_pixels);dce_v10_0_grph_enable (crtc, true);
drivers/gpu/drm/amd/amdgpu/dce_v11_0.c +1 -1
@@ -2076,7 +2076,7 @@ static int dce_v11_0_crtc_do_set_base(struct drm_crtc *crtc,WREG32 (mmGRPH_X_END + amdgpu_crtc->crtc_offset, target_fb->width);WREG32 (mmGRPH_Y_END + amdgpu_crtc->crtc_offset, target_fb->height); - fb_pitch_pixels = target_fb->pitches[0 ] / target_fb->format->cpp[0 ]; + fb_pitch_pixels = target_fb->pitches[0 ] / target_fb->format->bpp[0 ] /8 ;WREG32 (mmGRPH_PITCH + amdgpu_crtc->crtc_offset, fb_pitch_pixels);dce_v11_0_grph_enable (crtc, true);
drivers/gpu/drm/amd/amdgpu/dce_v6_0.c +1 -1
@@ -1969,7 +1969,7 @@ static int dce_v6_0_crtc_do_set_base(struct drm_crtc *crtc,WREG32 (mmGRPH_X_END + amdgpu_crtc->crtc_offset, target_fb->width);WREG32 (mmGRPH_Y_END + amdgpu_crtc->crtc_offset, target_fb->height); - fb_pitch_pixels = target_fb->pitches[0 ] / target_fb->format->cpp[0 ]; + fb_pitch_pixels = target_fb->pitches[0 ] / target_fb->format->bpp[0 ] /8 ;WREG32 (mmGRPH_PITCH + amdgpu_crtc->crtc_offset, fb_pitch_pixels);dce_v6_0_grph_enable (crtc, true);
drivers/gpu/drm/amd/amdgpu/dce_v8_0.c +1 -1
@@ -1943,7 +1943,7 @@ static int dce_v8_0_crtc_do_set_base(struct drm_crtc *crtc,WREG32 (mmGRPH_X_END + amdgpu_crtc->crtc_offset, target_fb->width);WREG32 (mmGRPH_Y_END + amdgpu_crtc->crtc_offset, target_fb->height); - fb_pitch_pixels = target_fb->pitches[0 ] / target_fb->format->cpp[0 ]; + fb_pitch_pixels = target_fb->pitches[0 ] / target_fb->format->bpp[0 ] /8 ;WREG32 (mmGRPH_PITCH + amdgpu_crtc->crtc_offset, fb_pitch_pixels);dce_v8_0_grph_enable (crtc, true);
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +3 -3
@@ -2746,7 +2746,7 @@ fill_plane_buffer_attributes(struct amdgpu_device *adev, plane_size->grph.surface_size.width = fb->width; plane_size->grph.surface_size.height = fb->height; plane_size->grph.surface_pitch = - fb->pitches[0 ] / fb->format->cpp[0 ]; + fb->pitches[0 ] / fb->format->bpp[0 ] /8 ; address->type =PLN_ADDR_TYPE_GRAPHICS ; address->grph.addr.low_part =lower_32_bits (afb->address);
@@ -2759,7 +2759,7 @@ fill_plane_buffer_attributes(struct amdgpu_device *adev, plane_size->video.luma_size.width = fb->width; plane_size->video.luma_size.height = fb->height; plane_size->video.luma_pitch = - fb->pitches[0 ] / fb->format->cpp[0 ]; + fb->pitches[0 ] / fb->format->bpp[0 ] /8 ; plane_size->video.chroma_size.x =0 ; plane_size->video.chroma_size.y =0 ;
@@ -2768,7 +2768,7 @@ fill_plane_buffer_attributes(struct amdgpu_device *adev, plane_size->video.chroma_size.height = fb->height /2 ; plane_size->video.chroma_pitch = - fb->pitches[1 ] / fb->format->cpp[1 ]; + fb->pitches[1 ] / fb->format->bpp[1 ] /8 ; address->type =PLN_ADDR_TYPE_VIDEO_PROGRESSIVE ; address->video_progressive.luma_addr.low_part =
Signature · 8 lines
2.7.4 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 7/36 drm/gma500: 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/gma500/framebuffer.c | 4 ++-- drivers/gpu/drm/gma500/gma_display.c | 4 ++-- drivers/gpu/drm/gma500/mdfld_intel_display.c | 6 +++--- drivers/gpu/drm/gma500/oaktrail_crtc.c | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-)
drivers/gpu/drm/gma500/framebuffer.c +2 -2
@@ -61,7 +61,7 @@ static int psbfb_setcolreg(unsigned regno, unsigned red, unsigned green, (transp << info->var.transp.offset);if (regno <16 ) { -switch (fb->format->cpp[0 ] *8 ) { +switch (fb->format->bpp[0 ]) {case 16 : ((uint32_t *) info->pseudo_palette)[regno] = v;break ;
@@ -221,7 +221,7 @@ static int psb_framebuffer_init(struct drm_device *dev,* 4 bytes per pixel. */ info =drm_get_format_info (dev, mode_cmd); -if (!info || !info->depth || info->cpp[0 ] >4 ) +if (!info || !info->depth || info->bpp[0 ] >32 )return -EINVAL ;if (mode_cmd->pitches[0 ] &63 )
drivers/gpu/drm/gma500/gma_display.c +2 -2
@@ -78,14 +78,14 @@ int gma_pipe_set_base(struct drm_crtc *crtc, int x, int y,if (ret <0 ) goto gma_pipe_set_base_exit; start = gtt->offset; - offset = y * fb->pitches[0 ] + x * fb->format->cpp[0 ]; + offset = y * fb->pitches[0 ] + x * fb->format->bpp[0 ] /8 ;REG_WRITE (map->stride, fb->pitches[0 ]); dspcntr =REG_READ (map->cntr); dspcntr &= ~DISPPLANE_PIXFORMAT_MASK ; -switch (fb->format->cpp[0 ] *8 ) { +switch (fb->format->bpp[0 ]) {case 8 : dspcntr |=DISPPLANE_8BPP ;break ;
drivers/gpu/drm/gma500/mdfld_intel_display.c +3 -3
@@ -139,7 +139,7 @@ static int check_fb(struct drm_framebuffer *fb)if (!fb)return 0 ; -switch (fb->format->cpp[0 ] *8 ) { +switch (fb->format->bpp[0 ]) {case 8 :case 16 :case 24 :
@@ -187,13 +187,13 @@ static int mdfld__intel_pipe_set_base(struct drm_crtc *crtc, int x, int y,return 0 ; start =to_gtt_range (fb->obj[0 ])->offset; - offset = y * fb->pitches[0 ] + x * fb->format->cpp[0 ]; + offset = y * fb->pitches[0 ] + x * fb->format->bpp[0 ] /8 ;REG_WRITE (map->stride, fb->pitches[0 ]); dspcntr =REG_READ (map->cntr); dspcntr &= ~DISPPLANE_PIXFORMAT_MASK ; -switch (fb->format->cpp[0 ] *8 ) { +switch (fb->format->bpp[0 ]) {case 8 : dspcntr |=DISPPLANE_8BPP ;break ;
drivers/gpu/drm/gma500/oaktrail_crtc.c +2 -2
@@ -607,14 +607,14 @@ static int oaktrail_pipe_set_base(struct drm_crtc *crtc,return 0 ; start =to_gtt_range (fb->obj[0 ])->offset; - offset = y * fb->pitches[0 ] + x * fb->format->cpp[0 ]; + offset = y * fb->pitches[0 ] + x * fb->format->bpp[0 ] /8 ;REG_WRITE (map->stride, fb->pitches[0 ]); dspcntr =REG_READ (map->cntr); dspcntr &= ~DISPPLANE_PIXFORMAT_MASK ; -switch (fb->format->cpp[0 ] *8 ) { +switch (fb->format->bpp[0 ]) {case 8 : dspcntr |=DISPPLANE_8BPP ;break ;
Signature · 1 line
2.7.4
PATCH 8/36 drm/msm: use bpp instead of cpp for drm_format_info
In reply to Sandy Huangcpp[BytePerPlane] can't describe the 10bit data format correctly, So we use bpp[BitPerPlane] to instead cpp.
--- drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 4 ++-- drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c | 2 +- drivers/gpu/drm/msm/disp/mdp5/mdp5_smp.c | 2 +- drivers/gpu/drm/msm/msm_fb.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c +2 -2
@@ -1148,8 +1148,8 @@ static int _dpu_debugfs_status_show(struct seq_file *s, void *data) fb->base.id, (char *) &fb->format->format, fb->width, fb->height);for (i =0 ; i <ARRAY_SIZE (fb->format->cpp); ++i) -seq_printf (s,"cpp[%d]:%u " , - i, fb->format->cpp[i]); +seq_printf (s,"bpp[%d]:%u " , + i, fb->format->bpp[i]);seq_puts (s,"\n\t" );seq_printf (s,"modifier:%8llu " , fb->modifier);
drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c +1 -1
@@ -790,7 +790,7 @@ static void mdp5_crtc_restore_cursor(struct drm_crtc *crtc) width = mdp5_crtc->cursor.width; height = mdp5_crtc->cursor.height; - stride = width * info->cpp[0 ]; + stride = width * info->bpp[0 ] /8 ;get_roi (crtc, &roi_w, &roi_h);
drivers/gpu/drm/msm/disp/mdp5/mdp5_smp.c +1 -1
@@ -147,7 +147,7 @@ uint32_t mdp5_smp_calculate(struct mdp5_smp *smp,for (i =0 ; i < nplanes; i++) {int n, fetch_stride, cpp; - cpp = info->cpp[i]; + cpp = info->bpp[i] /8 ; fetch_stride = width * cpp / (i ? hsub :1 ); n =DIV_ROUND_UP (fetch_stride * nlines, smp->blk_size);
drivers/gpu/drm/msm/msm_fb.c +1 -1
@@ -172,7 +172,7 @@ static struct drm_framebuffer *msm_framebuffer_init(struct drm_device *dev,unsigned int min_size; min_size = (height -1 ) * mode_cmd->pitches[i] - + width * info->cpp[i] + + width * info->bpp[i] /8 + mode_cmd->offsets[i];if (bos[i]->size < min_size) {
Signature · 1 line
2.7.4
Re: [PATCH 08/36] drm/msm: use bpp instead of cpp for drm_format_info
Quoted 45 lines · Sandy Huang
cpp[BytePerPlane] can't describe the 10bit data format correctly, So we use bpp[BitPerPlane] to instead cpp.
Signed-off-by Sandy Huang <[email protected]>--- drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 4 ++-- drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c | 2 +- drivers/gpu/drm/msm/disp/mdp5/mdp5_smp.c | 2 +- drivers/gpu/drm/msm/msm_fb.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-)drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c +2
-2@@ -1148,8 +1148,8 @@ static int _dpu_debugfs_status_show(struct seq_file *s, void *data) fb->base.id, (char *) &fb->format->format, fb->width, fb->height);for (i =0 ; i <ARRAY_SIZE (fb->format->cpp); ++i) -seq_printf (s,"cpp[%d]:%u " , - i, fb->format->cpp[i]); +seq_printf (s,"bpp[%d]:%u " , + i, fb->format->bpp[i]);seq_puts (s,"\n\t" );seq_printf (s,"modifier:%8llu " , fb->modifier);drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c +1
-1@@ -790,7 +790,7 @@ static void mdp5_crtc_restore_cursor(struct drm_crtc *crtc) width = mdp5_crtc->cursor.width; height = mdp5_crtc->cursor.height; - stride = width * info->cpp[0 ]; + stride = width * info->bpp[0 ] /8 ;get_roi (crtc, &roi_w, &roi_h);drivers/gpu/drm/msm/disp/mdp5/mdp5_smp.c +0
-0
drivers/gpu/drm/msm/disp/mdp5/mdp5_smp.c uint32_t mdp5_smp_calculate(struct mdp5_smp *smp, · line 150
Quoted 5 lines
drivers/gpu/drm/msm/disp/mdp5/mdp5_smp.c +1
-1@@ -147,7 +147,7 @@ uint32_t mdp5_smp_calculate(struct mdp5_smp *smp,for (i =0 ; i < nplanes; i++) {int n, fetch_stride, cpp; - cpp = info->cpp[i]; + cpp = info->bpp[i] /8 ;
Unless I missed something in your first patch, I don't think this series is bisectable, ie. replacing cpp w/ bpp would cause everything else not to compile. Looks like there was an alternative proposal on the first patch, but if we do end up going this route, I think you should add bpp in the first patch, and remove cpp in the last patch. (And also probably sprinkle around WARN_ON(info->bpp[n] % 8) in places were it is expected to be a multiple of 8)
BR,
-R
Quoted 21 lines
drivers/gpu/drm/msm/disp/mdp5/mdp5_smp.c +0
-0fetch_stride = width * cpp / (i ? hsub :1 ); n =DIV_ROUND_UP (fetch_stride * nlines, smp->blk_size);drivers/gpu/drm/msm/msm_fb.c +1
-2@@ -172,7 +172,7 @@ static struct drm_framebuffer *msm_framebuffer_init(struct drm_device *dev,unsigned int min_size; min_size = (height -1 ) * mode_cmd->pitches[i] - + width * info->cpp[i] + + width * info->bpp[i] /8 + mode_cmd->offsets[i];if (bos[i]->size < min_size) { --2.7.4
PATCH 9/36 dm/vmwgfx: use bpp instead of cpp for drm_format_info
In reply to Sandy Huangcpp[BytePerPlane] can't describe the 10bit data format correctly, So we use bpp[BitPerPlane] to instead cpp.
--- 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(-)
drivers/gpu/drm/vmwgfx/vmwgfx_fb.c +2 -2
@@ -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;
drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c +2 -2
@@ -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. */
drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c +2 -2
@@ -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 ];
drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c +1 -1
@@ -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 ;
Signature · 8 lines
2.7.4 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 10/36 drm/arm: use bpp instead of cpp for drm_format_info
In reply to Sandy Huangcpp[BytePerPlane] can't describe the 10bit data format correctly, So we use bpp[BitPerPlane] to instead cpp.
--- drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c | 2 +- drivers/gpu/drm/arm/malidp_hw.c | 2 +- drivers/gpu/drm/arm/malidp_planes.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c +1 -1
@@ -89,7 +89,7 @@ komeda_fb_afbc_size_check(struct komeda_fb *kfb, struct drm_file *file, alignment_header); kfb->afbc_size = kfb->offset_payload + n_blocks * -ALIGN (info->cpp[0 ] *AFBC_SUPERBLK_PIXELS , +ALIGN (info->bpp[0 ] /8 *AFBC_SUPERBLK_PIXELS ,AFBC_SUPERBLK_ALIGNMENT ); min_size = kfb->afbc_size + fb->offsets[0 ];if (min_size > obj->size) {
drivers/gpu/drm/arm/malidp_hw.c +1 -1
@@ -384,7 +384,7 @@ static void malidp500_modeset(struct malidp_hw_device *hwdev, struct videomode *int malidp_format_get_bpp (u32 fmt) {const struct drm_format_info *info =drm_format_info (fmt); -int bpp = info->cpp[0 ] *8 ; +int bpp = info->bpp[0 ];if (bpp ==0 ) {switch (fmt) {
drivers/gpu/drm/arm/malidp_planes.c +1 -1
@@ -225,7 +225,7 @@ bool malidp_format_mod_supported(struct drm_device *drm,if (modifier &AFBC_SPLIT ) {if (!info->is_yuv) { -if (info->cpp[0 ] <=2 ) { +if (info->bpp[0 ] <=16 ) {DRM_DEBUG_KMS ("RGB formats <= 16bpp are not supported with SPLIT\n" );return false; }
Signature · 8 lines
2.7.4 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel