Commit 185e23e1 authored by Tomi Valkeinen's avatar Tomi Valkeinen

drm/omap: cleanup offset calculation

The code to calculate offset in dispc's calc_offset() is overly complex.
Simplify it.
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
parent 517a8a95
...@@ -1923,11 +1923,9 @@ static void calc_offset(u16 screen_width, u16 width, ...@@ -1923,11 +1923,9 @@ static void calc_offset(u16 screen_width, u16 width,
* field 0 = even field = bottom field * field 0 = even field = bottom field
* field 1 = odd field = top field * field 1 = odd field = top field
*/ */
*offset0 = field_offset * screen_width * ps;
*offset1 = 0; *offset1 = 0;
if (field_offset)
*offset0 = *offset1 + field_offset * screen_width * ps;
else
*offset0 = *offset1;
*row_inc = pixinc(1 + (y_predecim * screen_width - width * x_predecim) + *row_inc = pixinc(1 + (y_predecim * screen_width - width * x_predecim) +
(fieldmode ? screen_width : 0), ps); (fieldmode ? screen_width : 0), ps);
if (color_mode == OMAP_DSS_COLOR_YUV2 || if (color_mode == OMAP_DSS_COLOR_YUV2 ||
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment