diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2017-05-03 15:01:10 +0300 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2017-06-02 10:57:22 +0300 |
commit | 185e23e1f63aa3f2a7ad77f9315b5f8d84002bb0 (patch) | |
tree | b1f475a173661de6447231192ebfa658f87e3ff6 /drivers/gpu/drm/omapdrm/dss | |
parent | 517a8a9564c0dea98e6d4e2c7f0fe4cbb9b8c9ba (diff) | |
download | linux-185e23e1f63aa3f2a7ad77f9315b5f8d84002bb0.tar.xz |
drm/omap: cleanup offset calculation
The code to calculate offset in dispc's calc_offset() is overly complex.
Simplify it.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'drivers/gpu/drm/omapdrm/dss')
-rw-r--r-- | drivers/gpu/drm/omapdrm/dss/dispc.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c b/drivers/gpu/drm/omapdrm/dss/dispc.c index 77d10bf9285f..5c4288f44573 100644 --- a/drivers/gpu/drm/omapdrm/dss/dispc.c +++ b/drivers/gpu/drm/omapdrm/dss/dispc.c @@ -1923,11 +1923,9 @@ static void calc_offset(u16 screen_width, u16 width, * field 0 = even field = bottom field * field 1 = odd field = top field */ + *offset0 = field_offset * screen_width * ps; *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) + (fieldmode ? screen_width : 0), ps); if (color_mode == OMAP_DSS_COLOR_YUV2 || |