Skip to content

Commit

Permalink
drm/verisilicon: bias fb address for dual-head offset
Browse files Browse the repository at this point in the history
Signed-off-by: Icenowy Zheng <[email protected]>
Signed-off-by: Han Gao <[email protected]>
  • Loading branch information
Icenowy authored and RevySR committed Sep 16, 2024
1 parent 3f89362 commit 8ffdabd
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 30 deletions.
25 changes: 25 additions & 0 deletions drivers/gpu/drm/verisilicon/vs_dc.c
Original file line number Diff line number Diff line change
Expand Up @@ -497,18 +497,43 @@ static void update_fb(struct vs_plane *plane, u8 display_id,
struct vs_plane_state *plane_state = to_vs_plane_state(state);
struct drm_framebuffer *drm_fb = state->fb;
struct drm_rect *src = &state->src;
u32 src_x, src_y;

src_y = src->y1 >> 16;
src_x = src->x1 >> 16;

fb->display_id = display_id;
fb->y_address = plane->dma_addr[0];
if (src_y)
fb->y_address += src_y * drm_fb->pitches[0];
if (src_x)
fb->y_address += src_x * drm_fb->format->cpp[0];

fb->y_stride = drm_fb->pitches[0];
if (drm_fb->format->format == DRM_FORMAT_YVU420) {
fb->u_address = plane->dma_addr[2];
if (src_y)
fb->u_address += src_y * drm_fb->pitches[2];
if (src_x)
fb->u_address += src_x * drm_fb->format->cpp[2];
fb->v_address = plane->dma_addr[1];
if (src_y)
fb->v_address += src_y * drm_fb->pitches[1];
if (src_x)
fb->v_address += src_x * drm_fb->format->cpp[1];
fb->u_stride = drm_fb->pitches[2];
fb->v_stride = drm_fb->pitches[1];
} else {
fb->u_address = plane->dma_addr[1];
if (src_y)
fb->u_address += src_y * drm_fb->pitches[1];
if (src_x)
fb->u_address += src_x * drm_fb->format->cpp[1];
fb->v_address = plane->dma_addr[2];
if (src_y)
fb->v_address += src_y * drm_fb->pitches[2];
if (src_x)
fb->v_address += src_x * drm_fb->format->cpp[2];
fb->u_stride = drm_fb->pitches[1];
fb->v_stride = drm_fb->pitches[2];
}
Expand Down
30 changes: 0 additions & 30 deletions drivers/gpu/drm/verisilicon/vs_dc.c.rej

This file was deleted.

0 comments on commit 8ffdabd

Please sign in to comment.