drm/omap: Pass drm_display_mode to .check_timings() and .set_timings()

The omap_dss_device .check_timings() and .set_timings() operations
operate on struct videomode, while the DRM API operates on struct
drm_display_mode. This forces conversion from to videomode in the
callers. While that's not a problem per se, it creates a difference with
the drm_bridge API.

Replace the videomode parameter to the .check_timings() and
.set_timings() operations with a drm_display_mode. This pushed the
conversion to videomode down to the DSS devices in some cases. If needed
they will be converted to operate on drm_display_mode natively.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Tested-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
This commit is contained in:
Laurent Pinchart
2018-09-21 17:00:29 +03:00
committed by Tomi Valkeinen
parent d68164fe29
commit 41322aa691
9 changed files with 46 additions and 48 deletions

View File

@@ -206,36 +206,37 @@ static void sdi_display_disable(struct omap_dss_device *dssdev)
}
static void sdi_set_timings(struct omap_dss_device *dssdev,
const struct videomode *vm)
const struct drm_display_mode *mode)
{
struct sdi_device *sdi = dssdev_to_sdi(dssdev);
sdi->vm = *vm;
drm_display_mode_to_videomode(mode, &sdi->vm);
}
static int sdi_check_timings(struct omap_dss_device *dssdev,
struct videomode *vm)
struct drm_display_mode *mode)
{
struct sdi_device *sdi = dssdev_to_sdi(dssdev);
struct dispc_clock_info dispc_cinfo;
unsigned long pixelclock = mode->clock * 1000;
unsigned long fck;
unsigned long pck;
int r;
if (vm->pixelclock == 0)
if (pixelclock == 0)
return -EINVAL;
r = sdi_calc_clock_div(sdi, vm->pixelclock, &fck, &dispc_cinfo);
r = sdi_calc_clock_div(sdi, pixelclock, &fck, &dispc_cinfo);
if (r)
return r;
pck = fck / dispc_cinfo.lck_div / dispc_cinfo.pck_div;
if (pck != vm->pixelclock) {
if (pck != pixelclock) {
DSSWARN("Pixel clock adjusted from %lu Hz to %lu Hz\n",
vm->pixelclock, pck);
pixelclock, pck);
vm->pixelclock = pck;
mode->clock = pck / 1000;
}
return 0;