Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions drivers/gpu/drm/vc4/vc4_plane.c
Original file line number Diff line number Diff line change
Expand Up @@ -851,6 +851,9 @@ static size_t vc6_upm_size(const struct drm_plane_state *state,
else
stride = ALIGN(state->fb->width, 128);
}
if (!plane && (state->fb->format->format == DRM_FORMAT_YUV444 ||
state->fb->format->format == DRM_FORMAT_YVU444))
stride <<= 1;
/*
* TODO: This only works for raster formats, and is sub-optimal
* for buffers with a stride aligned on 32 bytes.
Expand Down Expand Up @@ -1854,6 +1857,24 @@ static int vc6_plane_mode_set(struct drm_plane *plane,
if (ret)
return ret;

if (state->fb->format->format == DRM_FORMAT_YUV444 ||
state->fb->format->format == DRM_FORMAT_YVU444) {
/* Similar to YUV422 requiring the chroma scaler to always be
* enabled that is handled in vc4_plane_setup_clipping_and_scaling,
* GEN6 requires the scaler for the luma channel to be enabled
* for YUV444.
*/
if (vc4_state->x_scaling[0] == VC4_SCALING_NONE) {
vc4_state->x_scaling[0] = VC4_SCALING_PPF;
vc4_state->is_unity = false;
}

if (vc4_state->y_scaling[0] == VC4_SCALING_NONE) {
vc4_state->y_scaling[0] = VC4_SCALING_PPF;
vc4_state->is_unity = false;
}
}

if (!vc4_state->src_w[0] || !vc4_state->src_h[0] ||
!vc4_state->crtc_w || !vc4_state->crtc_h) {
/* 0 source size probably means the plane is offscreen.
Expand Down
Loading