Skip to content

Commit

Permalink
drm: vc4: Switch to using the buffer height for column stride
Browse files Browse the repository at this point in the history
Using buffer size / pitch for column stride fails due to the
buffer size being aligned to the page size.

We can get the underlying buffer geometry from drm_framebuffer_plane_height
although the size of any planes are computed based on the format
subsampling rather than being values passed in. That may limit
some cases.

Signed-off-by: Dave Stevenson <[email protected]>
  • Loading branch information
6by9 committed Nov 20, 2024
1 parent 695da32 commit 7bec748
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/gpu/drm/vc4/vc4_plane.c
Original file line number Diff line number Diff line change
Expand Up @@ -1472,7 +1472,7 @@ static int vc4_plane_mode_set(struct drm_plane *plane,
* padded width
*/
gem_obj = drm_fb_dma_get_gem_obj(fb, i);
pitch[i] = gem_obj->base.size / fb->pitches[i];
pitch[i] = drm_framebuffer_plane_height(fb->height, fb, i);
break;
default:
pitch[i] = VC4_SET_FIELD(param, SCALER_TILE_HEIGHT);
Expand Down Expand Up @@ -1951,7 +1951,7 @@ static int vc6_plane_mode_set(struct drm_plane *plane,
* padded width
*/
gem_obj = drm_fb_dma_get_gem_obj(fb, i);
pitch[i] = gem_obj->base.size / fb->pitches[i];
pitch[i] = drm_framebuffer_plane_height(fb->height, fb, i);
break;
default:
pitch[i] = VC4_SET_FIELD(param, SCALER_TILE_HEIGHT);
Expand Down

0 comments on commit 7bec748

Please sign in to comment.