Re: [PATCH v2 2/4] drm/exynos: implement display-mode-check callback in mixer driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jan 4, 2013 at 8:53 AM, Rahul Sharma <rahul.sharma@xxxxxxxxxxx> wrote:
> This patch adds the implementation of check_mode callback in the mixer

s/check_mode/check_timing/

> driver. Based on the mixer version, correct set of restrictions will be
> exposed by the mixer driver. A resolution will be acceptable only if passes
> the criteria set by mixer and hdmi IPs.
>
> Signed-off-by: Rahul Sharma <rahul.sharma@xxxxxxxxxxx>
> Signed-off-by: Sean Paul <seanpaul@xxxxxxxxxxxx>
> ---
>  drivers/gpu/drm/exynos/exynos_mixer.c | 26 ++++++++++++++++++++++++++
>  1 file changed, 26 insertions(+)
>
> diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c
> index 21db895..c1f2e7a 100644
> --- a/drivers/gpu/drm/exynos/exynos_mixer.c
> +++ b/drivers/gpu/drm/exynos/exynos_mixer.c
> @@ -810,6 +810,29 @@ static void mixer_win_disable(void *ctx, int win)
>         mixer_ctx->win_data[win].enabled = false;
>  }
>
> +int mixer_check_timing(void *ctx, struct fb_videomode *timing)
> +{
> +       struct mixer_context *mixer_ctx = ctx;
> +       unsigned int w, h;

xres and yres are defined as u32 in fb_videomode

> +
> +       w = timing->xres;
> +       h = timing->yres;
> +
> +       DRM_DEBUG_KMS("%s : xres=%d, yres=%d, refresh=%d, intl=%d\n",
> +               __func__, timing->xres, timing->yres,
> +               timing->refresh, (timing->vmode &
> +               FB_VMODE_INTERLACED) ? true : false);
> +
> +       if (mixer_ctx->mxr_ver == MXR_VER_0_0_0_16)
> +               return 0;
> +
> +       if ((w >= 464 && w <= 720 && h >= 261 && h <= 576) ||
> +               (w >= 1024 && w <= 1280 && h >= 576 && h <= 720) ||
> +               (w >= 1664 && w <= 1920 && h >= 936 && h <= 1080))
> +               return 0;
> +
> +       return -EINVAL;
> +}
>  static void mixer_wait_for_vblank(void *ctx)
>  {
>         struct mixer_context *mixer_ctx = ctx;
> @@ -947,6 +970,9 @@ static struct exynos_mixer_ops mixer_ops = {
>         .win_mode_set           = mixer_win_mode_set,
>         .win_commit             = mixer_win_commit,
>         .win_disable            = mixer_win_disable,
> +
> +       /* display */
> +       .check_timing   = mixer_check_timing,
>  };
>
>  /* for pageflip event */
> --
> 1.8.0
>
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux