[PATCH 15/29] drm/omap: venc: List both PAL and NTSC modes
Sebastian Reichel
sebastian.reichel at collabora.com
Sun Dec 9 22:03:13 UTC 2018
Hi,
On Wed, Dec 05, 2018 at 05:00:08PM +0200, Laurent Pinchart wrote:
> The TV encoder supports both PAL and NTSC modes, but when queried for
> the list of modes it supports, only the currently selected mode is
> reported. Fix it and report the two modes unconditionally.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> ---
Reviewed-by: Sebastian Reichel <sebastian.reichel at collabora.com>
-- Sebastian
> drivers/gpu/drm/omapdrm/dss/venc.c | 25 +++++++++++++++++++------
> 1 file changed, 19 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/omapdrm/dss/venc.c b/drivers/gpu/drm/omapdrm/dss/venc.c
> index f1abb4195a76..638cfd69ccf6 100644
> --- a/drivers/gpu/drm/omapdrm/dss/venc.c
> +++ b/drivers/gpu/drm/omapdrm/dss/venc.c
> @@ -551,14 +551,27 @@ static void venc_display_disable(struct omap_dss_device *dssdev)
> static int venc_get_modes(struct omap_dss_device *dssdev,
> struct drm_connector *connector)
> {
> - struct venc_device *venc = dssdev_to_venc(dssdev);
> - int r;
> + static const struct videomode *modes[] = {
> + &omap_dss_pal_vm,
> + &omap_dss_ntsc_vm,
> + };
> + unsigned int i;
>
> - mutex_lock(&venc->venc_lock);
> - r = omapdss_display_get_modes(connector, &venc->vm);
> - mutex_unlock(&venc->venc_lock);
> + for (i = 0; i < ARRAY_SIZE(modes); ++i) {
> + struct drm_display_mode *mode;
>
> - return r;
> + mode = drm_mode_create(connector->dev);
> + if (!mode)
> + return i;
> +
> + drm_display_mode_from_videomode(modes[i], mode);
> +
> + mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED;
> + drm_mode_set_name(mode);
> + drm_mode_probed_add(connector, mode);
> + }
> +
> + return ARRAY_SIZE(modes);
> }
>
> static void venc_set_timings(struct omap_dss_device *dssdev,
> --
> Regards,
>
> Laurent Pinchart
>
> _______________________________________________
> dri-devel mailing list
> dri-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20181209/c0c5c41f/attachment.sig>
More information about the dri-devel
mailing list