Message ID | 1486458995-31018-22-git-send-email-shawnguo@kernel.org |
---|---|
State | New |
Headers | show |
Series | Add vblank hooks to struct drm_crtc_funcs | expand |
On 02/07/17 11:16, Shawn Guo wrote: > From: Shawn Guo <shawn.guo@linaro.org> > > The vblank hooks in struct drm_driver are deprecated and only meant for > legacy drivers. For modern drivers with DRIVER_MODESET flag, the hooks > in struct drm_crtc_funcs should be used instead. > > While at it, the 'return' of .disable_vblank is dropped to fix the > following checkpatch warning. > > WARNING: void function return statements are not generally useful > > Signed-off-by: Shawn Guo <shawn.guo@linaro.org> > Cc: Jyri Sarha <jsarha@ti.com> Acked-by: Jyri Sarha <jsarha@ti.com> > --- > drivers/gpu/drm/tilcdc/tilcdc_crtc.c | 11 +++++++++++ > drivers/gpu/drm/tilcdc/tilcdc_drv.c | 12 ------------ > 2 files changed, 11 insertions(+), 12 deletions(-) > > diff --git a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c > index f80bf9385e41..93505bcfdf4b 100644 > --- a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c > +++ b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c > @@ -695,6 +695,15 @@ static int tilcdc_crtc_atomic_check(struct drm_crtc *crtc, > return 0; > } > > +static int tilcdc_crtc_enable_vblank(struct drm_crtc *crtc) > +{ > + return 0; > +} > + > +static void tilcdc_crtc_disable_vblank(struct drm_crtc *crtc) > +{ > +} > + > static const struct drm_crtc_funcs tilcdc_crtc_funcs = { > .destroy = tilcdc_crtc_destroy, > .set_config = drm_atomic_helper_set_config, > @@ -702,6 +711,8 @@ static int tilcdc_crtc_atomic_check(struct drm_crtc *crtc, > .reset = drm_atomic_helper_crtc_reset, > .atomic_duplicate_state = drm_atomic_helper_crtc_duplicate_state, > .atomic_destroy_state = drm_atomic_helper_crtc_destroy_state, > + .enable_vblank = tilcdc_crtc_enable_vblank, > + .disable_vblank = tilcdc_crtc_disable_vblank, > }; > > static const struct drm_crtc_helper_funcs tilcdc_crtc_helper_funcs = { > diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c b/drivers/gpu/drm/tilcdc/tilcdc_drv.c > index d5bc98e283d9..81d80a2ffeb1 100644 > --- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c > +++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c > @@ -437,16 +437,6 @@ static irqreturn_t tilcdc_irq(int irq, void *arg) > return tilcdc_crtc_irq(priv->crtc); > } > > -static int tilcdc_enable_vblank(struct drm_device *dev, unsigned int pipe) > -{ > - return 0; > -} > - > -static void tilcdc_disable_vblank(struct drm_device *dev, unsigned int pipe) > -{ > - return; > -} > - > #if defined(CONFIG_DEBUG_FS) > static const struct { > const char *name; > @@ -557,8 +547,6 @@ static int tilcdc_debugfs_init(struct drm_minor *minor) > DRIVER_PRIME | DRIVER_ATOMIC), > .lastclose = tilcdc_lastclose, > .irq_handler = tilcdc_irq, > - .enable_vblank = tilcdc_enable_vblank, > - .disable_vblank = tilcdc_disable_vblank, > .gem_free_object_unlocked = drm_gem_cma_free_object, > .gem_vm_ops = &drm_gem_cma_vm_ops, > .dumb_create = drm_gem_cma_dumb_create, >
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c index f80bf9385e41..93505bcfdf4b 100644 --- a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c +++ b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c @@ -695,6 +695,15 @@ static int tilcdc_crtc_atomic_check(struct drm_crtc *crtc, return 0; } +static int tilcdc_crtc_enable_vblank(struct drm_crtc *crtc) +{ + return 0; +} + +static void tilcdc_crtc_disable_vblank(struct drm_crtc *crtc) +{ +} + static const struct drm_crtc_funcs tilcdc_crtc_funcs = { .destroy = tilcdc_crtc_destroy, .set_config = drm_atomic_helper_set_config, @@ -702,6 +711,8 @@ static int tilcdc_crtc_atomic_check(struct drm_crtc *crtc, .reset = drm_atomic_helper_crtc_reset, .atomic_duplicate_state = drm_atomic_helper_crtc_duplicate_state, .atomic_destroy_state = drm_atomic_helper_crtc_destroy_state, + .enable_vblank = tilcdc_crtc_enable_vblank, + .disable_vblank = tilcdc_crtc_disable_vblank, }; static const struct drm_crtc_helper_funcs tilcdc_crtc_helper_funcs = { diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c b/drivers/gpu/drm/tilcdc/tilcdc_drv.c index d5bc98e283d9..81d80a2ffeb1 100644 --- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c +++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c @@ -437,16 +437,6 @@ static irqreturn_t tilcdc_irq(int irq, void *arg) return tilcdc_crtc_irq(priv->crtc); } -static int tilcdc_enable_vblank(struct drm_device *dev, unsigned int pipe) -{ - return 0; -} - -static void tilcdc_disable_vblank(struct drm_device *dev, unsigned int pipe) -{ - return; -} - #if defined(CONFIG_DEBUG_FS) static const struct { const char *name; @@ -557,8 +547,6 @@ static int tilcdc_debugfs_init(struct drm_minor *minor) DRIVER_PRIME | DRIVER_ATOMIC), .lastclose = tilcdc_lastclose, .irq_handler = tilcdc_irq, - .enable_vblank = tilcdc_enable_vblank, - .disable_vblank = tilcdc_disable_vblank, .gem_free_object_unlocked = drm_gem_cma_free_object, .gem_vm_ops = &drm_gem_cma_vm_ops, .dumb_create = drm_gem_cma_dumb_create,