Commit 62db7d1e authored by Daniel Vetter's avatar Daniel Vetter

drm/simple-kms: Standardize arguments for callbacks

Passing the wrong type feels icky, everywhere else we use the pipe as
the first parameter. Spotted while discussing patches with Thomas
Zimmermann.

v2: Make xen compile correctly

Acked-By: Thomas Zimmermann <tzimmermann@suse.de> (v1)
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Noralf Trønnes <noralf@tronnes.org>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Eric Anholt <eric@anholt.net>
Cc: Emil Velikov <emil.velikov@collabora.com>
Cc: virtualization@lists.linux-foundation.org
Cc: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191023101256.20509-1-daniel.vetter@ffwll.ch
parent f45f57cc
...@@ -390,7 +390,7 @@ static int cirrus_conn_init(struct cirrus_device *cirrus) ...@@ -390,7 +390,7 @@ static int cirrus_conn_init(struct cirrus_device *cirrus)
/* ------------------------------------------------------------------ */ /* ------------------------------------------------------------------ */
/* cirrus (simple) display pipe */ /* cirrus (simple) display pipe */
static enum drm_mode_status cirrus_pipe_mode_valid(struct drm_crtc *crtc, static enum drm_mode_status cirrus_pipe_mode_valid(struct drm_simple_display_pipe *pipe,
const struct drm_display_mode *mode) const struct drm_display_mode *mode)
{ {
if (cirrus_check_size(mode->hdisplay, mode->vdisplay, NULL) < 0) if (cirrus_check_size(mode->hdisplay, mode->vdisplay, NULL) < 0)
......
...@@ -43,7 +43,7 @@ drm_simple_kms_crtc_mode_valid(struct drm_crtc *crtc, ...@@ -43,7 +43,7 @@ drm_simple_kms_crtc_mode_valid(struct drm_crtc *crtc,
/* Anything goes */ /* Anything goes */
return MODE_OK; return MODE_OK;
return pipe->funcs->mode_valid(crtc, mode); return pipe->funcs->mode_valid(pipe, mode);
} }
static int drm_simple_kms_crtc_check(struct drm_crtc *crtc, static int drm_simple_kms_crtc_check(struct drm_crtc *crtc,
......
...@@ -48,10 +48,10 @@ irqreturn_t pl111_irq(int irq, void *data) ...@@ -48,10 +48,10 @@ irqreturn_t pl111_irq(int irq, void *data)
} }
static enum drm_mode_status static enum drm_mode_status
pl111_mode_valid(struct drm_crtc *crtc, pl111_mode_valid(struct drm_simple_display_pipe *pipe,
const struct drm_display_mode *mode) const struct drm_display_mode *mode)
{ {
struct drm_device *drm = crtc->dev; struct drm_device *drm = pipe->crtc.dev;
struct pl111_drm_dev_private *priv = drm->dev_private; struct pl111_drm_dev_private *priv = drm->dev_private;
u32 cpp = priv->variant->fb_bpp / 8; u32 cpp = priv->variant->fb_bpp / 8;
u64 bw; u64 bw;
......
...@@ -270,11 +270,12 @@ static void display_update(struct drm_simple_display_pipe *pipe, ...@@ -270,11 +270,12 @@ static void display_update(struct drm_simple_display_pipe *pipe,
} }
static enum drm_mode_status static enum drm_mode_status
display_mode_valid(struct drm_crtc *crtc, const struct drm_display_mode *mode) display_mode_valid(struct drm_simple_display_pipe *pipe,
const struct drm_display_mode *mode)
{ {
struct xen_drm_front_drm_pipeline *pipeline = struct xen_drm_front_drm_pipeline *pipeline =
container_of(crtc, struct xen_drm_front_drm_pipeline, container_of(pipe, struct xen_drm_front_drm_pipeline,
pipe.crtc); pipe);
if (mode->hdisplay != pipeline->width) if (mode->hdisplay != pipeline->width)
return MODE_ERROR; return MODE_ERROR;
......
...@@ -49,7 +49,7 @@ struct drm_simple_display_pipe_funcs { ...@@ -49,7 +49,7 @@ struct drm_simple_display_pipe_funcs {
* *
* drm_mode_status Enum * drm_mode_status Enum
*/ */
enum drm_mode_status (*mode_valid)(struct drm_crtc *crtc, enum drm_mode_status (*mode_valid)(struct drm_simple_display_pipe *pipe,
const struct drm_display_mode *mode); const struct drm_display_mode *mode);
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment