Skip to content

Commit

Permalink
CHROMIUM: drm/tegra: Add check for planar rotations
Browse files Browse the repository at this point in the history
Only Window A in T210 platform supports planar rotation. All other
windows would result in display underflows if configured to perform
planar rotation. This change adds check to verify this condition in
plane's atomic check function.

BUG=chrome-os-partner:47938
TEST=Run CTS Verifier app, select Camera Orientation, take a photo,
     click green checkmark and then press back button, no underflows.

Change-Id: I3cf0852cef240d5f7cf897c80ae6569775a7c6a3
Signed-off-by: Maneet Singh <mmaneetsingh@nvidia.com>
Reviewed-on: https://chromium-review.googlesource.com/314501
Reviewed-by: Puneet Kumar <puneetster@chromium.org>
Commit-Queue: Puneet Kumar <puneetster@chromium.org>
Tested-by: Puneet Kumar <puneetster@chromium.org>
(cherry picked from commit 0a2a20f)
Reviewed-on: https://chromium-review.googlesource.com/314319
  • Loading branch information
Maneet Singh authored and Puneet Kumar committed Nov 26, 2015
1 parent 5283e59 commit 673a0c7
Showing 1 changed file with 39 additions and 15 deletions.
54 changes: 39 additions & 15 deletions drivers/gpu/drm/tegra/dc.c
Original file line number Diff line number Diff line change
@@ -35,6 +35,7 @@ enum la_ptsa_update {
struct tegra_dc_window_soc_info {
bool supports_h_filter;
bool supports_v_filter;
bool supports_planar_rotation;
};

struct tegra_dc_scale_limit {
@@ -781,6 +782,7 @@ static int tegra_plane_atomic_check(struct drm_plane *plane,
unsigned int limit;
unsigned int rotation = tegra_plane_simplify_rotation(state->rotation);
uint32_t crtc_w = state->crtc_w, crtc_h = state->crtc_h;
bool planar, supports_planar_rotation;

/* no need for further checks if the plane is being disabled */
if (!state->crtc)
@@ -791,6 +793,13 @@ static int tegra_plane_atomic_check(struct drm_plane *plane,
if (err < 0)
return err;

if (tegra_dc_format_is_yuv(plane_state->format, &planar)) {
supports_planar_rotation =
dc->soc->windows[tegra->index].supports_planar_rotation;
if ((planar && rotation) && !supports_planar_rotation)
return -EINVAL;
}

if (rotation & (BIT(DRM_ROTATE_270) | BIT(DRM_ROTATE_90))) {
crtc_w = state->crtc_h;
crtc_h = state->crtc_w;
@@ -3118,15 +3127,18 @@ static const struct tegra_dc_scale_limit tegra114_v_scale_down_limits[] = {
static const struct tegra_dc_window_soc_info tegra20_dc_window_soc_info[] = {
[0] = {
.supports_v_filter = false,
.supports_h_filter = false
.supports_h_filter = false,
.supports_planar_rotation = false
},
[1] = {
.supports_v_filter = true,
.supports_h_filter = true
.supports_h_filter = true,
.supports_planar_rotation = false
},
[2] = {
.supports_v_filter = false,
.supports_h_filter = true
.supports_h_filter = true,
.supports_planar_rotation = false
},
};

@@ -3150,15 +3162,18 @@ static const struct tegra_dc_soc_info tegra20_dc_soc_info = {
static const struct tegra_dc_window_soc_info tegra30_dc_window_soc_info[] = {
[0] = {
.supports_v_filter = false,
.supports_h_filter = false
.supports_h_filter = false,
.supports_planar_rotation = false
},
[1] = {
.supports_v_filter = true,
.supports_h_filter = true
.supports_h_filter = true,
.supports_planar_rotation = false
},
[2] = {
.supports_v_filter = false,
.supports_h_filter = true
.supports_h_filter = true,
.supports_planar_rotation = false
},
};

@@ -3182,15 +3197,18 @@ static const struct tegra_dc_soc_info tegra30_dc_soc_info = {
static const struct tegra_dc_window_soc_info tegra114_dc_window_soc_info[] = {
[0] = {
.supports_v_filter = true,
.supports_h_filter = true
.supports_h_filter = true,
.supports_planar_rotation = false
},
[1] = {
.supports_v_filter = true,
.supports_h_filter = true
.supports_h_filter = true,
.supports_planar_rotation = false
},
[2] = {
.supports_v_filter = true,
.supports_h_filter = true
.supports_h_filter = true,
.supports_planar_rotation = false
},
};

@@ -3218,15 +3236,18 @@ static const struct tegra_dc_soc_info tegra114_dc_soc_info = {
static const struct tegra_dc_window_soc_info tegra124_dc_window_soc_info[] = {
[0] = {
.supports_v_filter = true,
.supports_h_filter = true
.supports_h_filter = true,
.supports_planar_rotation = true
},
[1] = {
.supports_v_filter = true,
.supports_h_filter = true
.supports_h_filter = true,
.supports_planar_rotation = false
},
[2] = {
.supports_v_filter = true,
.supports_h_filter = true
.supports_h_filter = true,
.supports_planar_rotation = false
},
};

@@ -3254,15 +3275,18 @@ static const struct tegra_dc_soc_info tegra124_dc_soc_info = {
static const struct tegra_dc_window_soc_info tegra210_dc_window_soc_info[] = {
[0] = {
.supports_v_filter = true,
.supports_h_filter = true
.supports_h_filter = true,
.supports_planar_rotation = true
},
[1] = {
.supports_v_filter = true,
.supports_h_filter = true
.supports_h_filter = true,
.supports_planar_rotation = false
},
[2] = {
.supports_v_filter = true,
.supports_h_filter = true
.supports_h_filter = true,
.supports_planar_rotation = false
},
};

0 comments on commit 673a0c7

Please sign in to comment.