diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2017-10-26 07:40:13 -0400 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2018-03-01 02:18:18 -0500 |
commit | 1317ef2113a14b631df15c9d09ce1283836c1456 (patch) | |
tree | 75ccf444c58ab5ac11a757a9b2488717cb340e86 | |
parent | b994e53c2c6437689873af4ff61803bef78a2330 (diff) |
drm/omap: fix WB height with interlace
When using WB capture from interlaced source, we need to halve the
picture heights correctly.
Unfortunately the current dispc_ovl_setup_common() doesn't deal with
interlace very neatly, so the end result is a bit messy.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Acked-by: Benoit Parrot <bparrot@ti.com>
-rw-r--r-- | drivers/gpu/drm/omapdrm/dss/dispc.c | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c b/drivers/gpu/drm/omapdrm/dss/dispc.c index 000a3d4a27bf..72f00e8a1329 100644 --- a/drivers/gpu/drm/omapdrm/dss/dispc.c +++ b/drivers/gpu/drm/omapdrm/dss/dispc.c | |||
@@ -2597,18 +2597,19 @@ static int dispc_ovl_setup_common(struct dispc_device *dispc, | |||
2597 | out_width = out_width == 0 ? width : out_width; | 2597 | out_width = out_width == 0 ? width : out_width; |
2598 | out_height = out_height == 0 ? height : out_height; | 2598 | out_height = out_height == 0 ? height : out_height; |
2599 | 2599 | ||
2600 | if (ilace && height == out_height) | 2600 | if (plane != OMAP_DSS_WB) { |
2601 | fieldmode = true; | 2601 | if (ilace && height == out_height) |
2602 | 2602 | fieldmode = true; | |
2603 | if (ilace) { | 2603 | |
2604 | if (fieldmode) | 2604 | if (ilace) { |
2605 | in_height /= 2; | 2605 | if (fieldmode) |
2606 | pos_y /= 2; | 2606 | in_height /= 2; |
2607 | out_height /= 2; | 2607 | pos_y /= 2; |
2608 | 2608 | out_height /= 2; | |
2609 | DSSDBG("adjusting for ilace: height %d, pos_y %d, " | 2609 | |
2610 | "out_height %d\n", in_height, pos_y, | 2610 | DSSDBG("adjusting for ilace: height %d, pos_y %d, out_height %d\n", |
2611 | out_height); | 2611 | in_height, pos_y, out_height); |
2612 | } | ||
2612 | } | 2613 | } |
2613 | 2614 | ||
2614 | if (!dispc_ovl_color_mode_supported(dispc, plane, fourcc)) | 2615 | if (!dispc_ovl_color_mode_supported(dispc, plane, fourcc)) |
@@ -2771,6 +2772,9 @@ int dispc_wb_setup(struct dispc_device *dispc, | |||
2771 | enum omap_overlay_caps caps = | 2772 | enum omap_overlay_caps caps = |
2772 | OMAP_DSS_OVL_CAP_SCALE | OMAP_DSS_OVL_CAP_PRE_MULT_ALPHA; | 2773 | OMAP_DSS_OVL_CAP_SCALE | OMAP_DSS_OVL_CAP_PRE_MULT_ALPHA; |
2773 | 2774 | ||
2775 | if (vm->flags & DISPLAY_FLAGS_INTERLACED) | ||
2776 | in_height /= 2; | ||
2777 | |||
2774 | DSSDBG("dispc_wb_setup, pa %x, pa_uv %x, %d,%d -> %dx%d, cmode %x, " | 2778 | DSSDBG("dispc_wb_setup, pa %x, pa_uv %x, %d,%d -> %dx%d, cmode %x, " |
2775 | "rot %d\n", wi->paddr, wi->p_uv_addr, in_width, | 2779 | "rot %d\n", wi->paddr, wi->p_uv_addr, in_width, |
2776 | in_height, wi->width, wi->height, wi->fourcc, wi->rotation); | 2780 | in_height, wi->width, wi->height, wi->fourcc, wi->rotation); |