mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-02-09 00:05:09 +07:00
drm/omap: update for interlaced
'struct omap_video_timings' was updated w/ a 'bool interlaced'. Without a matching update in omap_connector, this field could have undefined values from the stack, which isn't quite ideal. Update the fxns to convert omapdss<->drm timings structs, and zero-init 'struct omap_video_timings' when it is declared on stack to avoid issues like this in the future. Signed-off-by: Rob Clark <rob@ti.com> Reviewed-by: Sumit Semwal <sumit.semwal@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
abf02cfc17
commit
0b0d7b62be
@ -48,13 +48,10 @@ static inline void copy_timings_omap_to_drm(struct drm_display_mode *mode,
|
|||||||
mode->vsync_end = mode->vsync_start + timings->vsw;
|
mode->vsync_end = mode->vsync_start + timings->vsw;
|
||||||
mode->vtotal = mode->vsync_end + timings->vbp;
|
mode->vtotal = mode->vsync_end + timings->vbp;
|
||||||
|
|
||||||
/* note: whether or not it is interlaced, +/- h/vsync, etc,
|
mode->flags = 0;
|
||||||
* which should be set in the mode flags, is not exposed in
|
|
||||||
* the omap_video_timings struct.. but hdmi driver tracks
|
if (timings->interlace)
|
||||||
* those separately so all we have to have to set the mode
|
mode->flags |= DRM_MODE_FLAG_INTERLACE;
|
||||||
* is the way to recover these timings values, and the
|
|
||||||
* omap_dss_driver would do the rest.
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void copy_timings_drm_to_omap(struct omap_video_timings *timings,
|
static inline void copy_timings_drm_to_omap(struct omap_video_timings *timings,
|
||||||
@ -71,6 +68,8 @@ static inline void copy_timings_drm_to_omap(struct omap_video_timings *timings,
|
|||||||
timings->vfp = mode->vsync_start - mode->vdisplay;
|
timings->vfp = mode->vsync_start - mode->vdisplay;
|
||||||
timings->vsw = mode->vsync_end - mode->vsync_start;
|
timings->vsw = mode->vsync_end - mode->vsync_start;
|
||||||
timings->vbp = mode->vtotal - mode->vsync_end;
|
timings->vbp = mode->vtotal - mode->vsync_end;
|
||||||
|
|
||||||
|
timings->interlace = !!(mode->flags & DRM_MODE_FLAG_INTERLACE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void omap_connector_dpms(struct drm_connector *connector, int mode)
|
static void omap_connector_dpms(struct drm_connector *connector, int mode)
|
||||||
@ -187,7 +186,7 @@ static int omap_connector_get_modes(struct drm_connector *connector)
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
struct drm_display_mode *mode = drm_mode_create(dev);
|
struct drm_display_mode *mode = drm_mode_create(dev);
|
||||||
struct omap_video_timings timings;
|
struct omap_video_timings timings = {0};
|
||||||
|
|
||||||
dssdrv->get_timings(dssdev, &timings);
|
dssdrv->get_timings(dssdev, &timings);
|
||||||
|
|
||||||
@ -291,7 +290,7 @@ void omap_connector_mode_set(struct drm_connector *connector,
|
|||||||
struct omap_connector *omap_connector = to_omap_connector(connector);
|
struct omap_connector *omap_connector = to_omap_connector(connector);
|
||||||
struct omap_dss_device *dssdev = omap_connector->dssdev;
|
struct omap_dss_device *dssdev = omap_connector->dssdev;
|
||||||
struct omap_dss_driver *dssdrv = dssdev->driver;
|
struct omap_dss_driver *dssdrv = dssdev->driver;
|
||||||
struct omap_video_timings timings;
|
struct omap_video_timings timings = {0};
|
||||||
|
|
||||||
copy_timings_drm_to_omap(&timings, mode);
|
copy_timings_drm_to_omap(&timings, mode);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user