aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2017-05-16 05:05:24 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2017-06-02 04:07:14 -0400
commit4eebb80e2465be3f5ec471547c455494c050ebd1 (patch)
treeb3bb0993cdde56c3620989b973d3809ebb9ed120
parent0bd97c42d975a1e0849105bb8f23a68490683aab (diff)
drm/omap: DRM_MODE_REFLECT_* instead of mirror boolean
Change dispc driver to use the DRM_MODE_REFLECT flags instead of a mirror boolean. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-rw-r--r--drivers/gpu/drm/omapdrm/dss/dispc.c24
-rw-r--r--drivers/gpu/drm/omapdrm/dss/omapdss.h2
-rw-r--r--drivers/gpu/drm/omapdrm/omap_plane.c1
3 files changed, 10 insertions, 17 deletions
diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c b/drivers/gpu/drm/omapdrm/dss/dispc.c
index 34c6a2aca014..53e2c93a5455 100644
--- a/drivers/gpu/drm/omapdrm/dss/dispc.c
+++ b/drivers/gpu/drm/omapdrm/dss/dispc.c
@@ -1805,8 +1805,7 @@ static void dispc_ovl_set_scaling(enum omap_plane_id plane,
1805} 1805}
1806 1806
1807static void dispc_ovl_set_rotation_attrs(enum omap_plane_id plane, u8 rotation, 1807static void dispc_ovl_set_rotation_attrs(enum omap_plane_id plane, u8 rotation,
1808 enum omap_dss_rotation_type rotation_type, 1808 enum omap_dss_rotation_type rotation_type, u32 fourcc)
1809 bool mirroring, u32 fourcc)
1810{ 1809{
1811 bool row_repeat = false; 1810 bool row_repeat = false;
1812 int vidrot = 0; 1811 int vidrot = 0;
@@ -1814,7 +1813,7 @@ static void dispc_ovl_set_rotation_attrs(enum omap_plane_id plane, u8 rotation,
1814 /* Note: DSS HW rotates clockwise, DRM_MODE_ROTATE_* counter-clockwise */ 1813 /* Note: DSS HW rotates clockwise, DRM_MODE_ROTATE_* counter-clockwise */
1815 if (fourcc == DRM_FORMAT_YUYV || fourcc == DRM_FORMAT_UYVY) { 1814 if (fourcc == DRM_FORMAT_YUYV || fourcc == DRM_FORMAT_UYVY) {
1816 1815
1817 if (mirroring) { 1816 if (rotation & DRM_MODE_REFLECT_X) {
1818 switch (rotation & DRM_MODE_ROTATE_MASK) { 1817 switch (rotation & DRM_MODE_ROTATE_MASK) {
1819 case DRM_MODE_ROTATE_0: 1818 case DRM_MODE_ROTATE_0:
1820 vidrot = 2; 1819 vidrot = 2;
@@ -2369,7 +2368,7 @@ static int dispc_ovl_setup_common(enum omap_plane_id plane,
2369 enum omap_overlay_caps caps, u32 paddr, u32 p_uv_addr, 2368 enum omap_overlay_caps caps, u32 paddr, u32 p_uv_addr,
2370 u16 screen_width, int pos_x, int pos_y, u16 width, u16 height, 2369 u16 screen_width, int pos_x, int pos_y, u16 width, u16 height,
2371 u16 out_width, u16 out_height, u32 fourcc, 2370 u16 out_width, u16 out_height, u32 fourcc,
2372 u8 rotation, bool mirror, u8 zorder, u8 pre_mult_alpha, 2371 u8 rotation, u8 zorder, u8 pre_mult_alpha,
2373 u8 global_alpha, enum omap_dss_rotation_type rotation_type, 2372 u8 global_alpha, enum omap_dss_rotation_type rotation_type,
2374 bool replication, const struct videomode *vm, 2373 bool replication, const struct videomode *vm,
2375 bool mem_to_mem) 2374 bool mem_to_mem)
@@ -2517,8 +2516,7 @@ static int dispc_ovl_setup_common(enum omap_plane_id plane,
2517 dispc_ovl_set_vid_color_conv(plane, cconv); 2516 dispc_ovl_set_vid_color_conv(plane, cconv);
2518 } 2517 }
2519 2518
2520 dispc_ovl_set_rotation_attrs(plane, rotation, rotation_type, mirror, 2519 dispc_ovl_set_rotation_attrs(plane, rotation, rotation_type, fourcc);
2521 fourcc);
2522 2520
2523 dispc_ovl_set_zorder(plane, caps, zorder); 2521 dispc_ovl_set_zorder(plane, caps, zorder);
2524 dispc_ovl_set_pre_mult_alpha(plane, caps, pre_mult_alpha); 2522 dispc_ovl_set_pre_mult_alpha(plane, caps, pre_mult_alpha);
@@ -2539,17 +2537,17 @@ static int dispc_ovl_setup(enum omap_plane_id plane,
2539 const bool replication = true; 2537 const bool replication = true;
2540 2538
2541 DSSDBG("dispc_ovl_setup %d, pa %pad, pa_uv %pad, sw %d, %d,%d, %dx%d ->" 2539 DSSDBG("dispc_ovl_setup %d, pa %pad, pa_uv %pad, sw %d, %d,%d, %dx%d ->"
2542 " %dx%d, cmode %x, rot %d, mir %d, chan %d repl %d\n", 2540 " %dx%d, cmode %x, rot %d, chan %d repl %d\n",
2543 plane, &oi->paddr, &oi->p_uv_addr, oi->screen_width, oi->pos_x, 2541 plane, &oi->paddr, &oi->p_uv_addr, oi->screen_width, oi->pos_x,
2544 oi->pos_y, oi->width, oi->height, oi->out_width, oi->out_height, 2542 oi->pos_y, oi->width, oi->height, oi->out_width, oi->out_height,
2545 oi->fourcc, oi->rotation, oi->mirror, channel, replication); 2543 oi->fourcc, oi->rotation, channel, replication);
2546 2544
2547 dispc_ovl_set_channel_out(plane, channel); 2545 dispc_ovl_set_channel_out(plane, channel);
2548 2546
2549 r = dispc_ovl_setup_common(plane, caps, oi->paddr, oi->p_uv_addr, 2547 r = dispc_ovl_setup_common(plane, caps, oi->paddr, oi->p_uv_addr,
2550 oi->screen_width, oi->pos_x, oi->pos_y, oi->width, oi->height, 2548 oi->screen_width, oi->pos_x, oi->pos_y, oi->width, oi->height,
2551 oi->out_width, oi->out_height, oi->fourcc, oi->rotation, 2549 oi->out_width, oi->out_height, oi->fourcc, oi->rotation,
2552 oi->mirror, oi->zorder, oi->pre_mult_alpha, oi->global_alpha, 2550 oi->zorder, oi->pre_mult_alpha, oi->global_alpha,
2553 oi->rotation_type, replication, vm, mem_to_mem); 2551 oi->rotation_type, replication, vm, mem_to_mem);
2554 2552
2555 return r; 2553 return r;
@@ -2571,13 +2569,12 @@ int dispc_wb_setup(const struct omap_dss_writeback_info *wi,
2571 OMAP_DSS_OVL_CAP_SCALE | OMAP_DSS_OVL_CAP_PRE_MULT_ALPHA; 2569 OMAP_DSS_OVL_CAP_SCALE | OMAP_DSS_OVL_CAP_PRE_MULT_ALPHA;
2572 2570
2573 DSSDBG("dispc_wb_setup, pa %x, pa_uv %x, %d,%d -> %dx%d, cmode %x, " 2571 DSSDBG("dispc_wb_setup, pa %x, pa_uv %x, %d,%d -> %dx%d, cmode %x, "
2574 "rot %d, mir %d\n", wi->paddr, wi->p_uv_addr, in_width, 2572 "rot %d\n", wi->paddr, wi->p_uv_addr, in_width,
2575 in_height, wi->width, wi->height, wi->fourcc, wi->rotation, 2573 in_height, wi->width, wi->height, wi->fourcc, wi->rotation);
2576 wi->mirror);
2577 2574
2578 r = dispc_ovl_setup_common(plane, caps, wi->paddr, wi->p_uv_addr, 2575 r = dispc_ovl_setup_common(plane, caps, wi->paddr, wi->p_uv_addr,
2579 wi->buf_width, pos_x, pos_y, in_width, in_height, wi->width, 2576 wi->buf_width, pos_x, pos_y, in_width, in_height, wi->width,
2580 wi->height, wi->fourcc, wi->rotation, wi->mirror, zorder, 2577 wi->height, wi->fourcc, wi->rotation, zorder,
2581 wi->pre_mult_alpha, global_alpha, wi->rotation_type, 2578 wi->pre_mult_alpha, global_alpha, wi->rotation_type,
2582 replication, vm, mem_to_mem); 2579 replication, vm, mem_to_mem);
2583 2580
@@ -3918,7 +3915,6 @@ static const struct dispc_errata_i734_data {
3918 .fourcc = DRM_FORMAT_XRGB8888, 3915 .fourcc = DRM_FORMAT_XRGB8888,
3919 .rotation = DRM_MODE_ROTATE_0, 3916 .rotation = DRM_MODE_ROTATE_0,
3920 .rotation_type = OMAP_DSS_ROT_NONE, 3917 .rotation_type = OMAP_DSS_ROT_NONE,
3921 .mirror = 0,
3922 .pos_x = 0, .pos_y = 0, 3918 .pos_x = 0, .pos_y = 0,
3923 .out_width = 0, .out_height = 0, 3919 .out_width = 0, .out_height = 0,
3924 .global_alpha = 0xff, 3920 .global_alpha = 0xff,
diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss.h b/drivers/gpu/drm/omapdrm/dss/omapdss.h
index 7e2fbc2a7e44..85953a0bc7c2 100644
--- a/drivers/gpu/drm/omapdrm/dss/omapdss.h
+++ b/drivers/gpu/drm/omapdrm/dss/omapdss.h
@@ -263,7 +263,6 @@ struct omap_overlay_info {
263 u32 fourcc; 263 u32 fourcc;
264 u8 rotation; 264 u8 rotation;
265 enum omap_dss_rotation_type rotation_type; 265 enum omap_dss_rotation_type rotation_type;
266 bool mirror;
267 266
268 u16 pos_x; 267 u16 pos_x;
269 u16 pos_y; 268 u16 pos_y;
@@ -311,7 +310,6 @@ struct omap_dss_writeback_info {
311 u32 fourcc; 310 u32 fourcc;
312 u8 rotation; 311 u8 rotation;
313 enum omap_dss_rotation_type rotation_type; 312 enum omap_dss_rotation_type rotation_type;
314 bool mirror;
315 u8 pre_mult_alpha; 313 u8 pre_mult_alpha;
316}; 314};
317 315
diff --git a/drivers/gpu/drm/omapdrm/omap_plane.c b/drivers/gpu/drm/omapdrm/omap_plane.c
index 688b358a13e5..2160f64548e0 100644
--- a/drivers/gpu/drm/omapdrm/omap_plane.c
+++ b/drivers/gpu/drm/omapdrm/omap_plane.c
@@ -67,7 +67,6 @@ static void omap_plane_atomic_update(struct drm_plane *plane,
67 info.rotation_type = OMAP_DSS_ROT_NONE; 67 info.rotation_type = OMAP_DSS_ROT_NONE;
68 info.rotation = DRM_MODE_ROTATE_0; 68 info.rotation = DRM_MODE_ROTATE_0;
69 info.global_alpha = 0xff; 69 info.global_alpha = 0xff;
70 info.mirror = 0;
71 info.zorder = state->zpos; 70 info.zorder = state->zpos;
72 71
73 /* update scanout: */ 72 /* update scanout: */