Message ID | 1486458995-31018-10-git-send-email-shawnguo@kernel.org |
---|---|
State | New |
Headers | show |
Series | Add vblank hooks to struct drm_crtc_funcs | expand |
On 2017-02-07 01: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. > > Signed-off-by: Shawn Guo <shawn.guo@linaro.org> > Cc: Stefan Agner <stefan@agner.ch> Acked-by: Stefan Agner <stefan@agner.ch> > --- > drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c | 26 ++++++++++++++++++++++++++ > drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 25 ------------------------- > 2 files changed, 26 insertions(+), 25 deletions(-) > > diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c > b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c > index deb57435cc89..cc4e944a1d3c 100644 > --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c > +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c > @@ -137,6 +137,30 @@ static void fsl_dcu_drm_crtc_mode_set_nofb(struct > drm_crtc *crtc) > .mode_set_nofb = fsl_dcu_drm_crtc_mode_set_nofb, > }; > > +static int fsl_dcu_drm_crtc_enable_vblank(struct drm_crtc *crtc) > +{ > + struct drm_device *dev = crtc->dev; > + struct fsl_dcu_drm_device *fsl_dev = dev->dev_private; > + unsigned int value; > + > + regmap_read(fsl_dev->regmap, DCU_INT_MASK, &value); > + value &= ~DCU_INT_MASK_VBLANK; > + regmap_write(fsl_dev->regmap, DCU_INT_MASK, value); > + > + return 0; > +} > + > +static void fsl_dcu_drm_crtc_disable_vblank(struct drm_crtc *crtc) > +{ > + struct drm_device *dev = crtc->dev; > + struct fsl_dcu_drm_device *fsl_dev = dev->dev_private; > + unsigned int value; > + > + regmap_read(fsl_dev->regmap, DCU_INT_MASK, &value); > + value |= DCU_INT_MASK_VBLANK; > + regmap_write(fsl_dev->regmap, DCU_INT_MASK, value); > +} > + > static const struct drm_crtc_funcs fsl_dcu_drm_crtc_funcs = { > .atomic_duplicate_state = drm_atomic_helper_crtc_duplicate_state, > .atomic_destroy_state = drm_atomic_helper_crtc_destroy_state, > @@ -144,6 +168,8 @@ static void fsl_dcu_drm_crtc_mode_set_nofb(struct > drm_crtc *crtc) > .page_flip = drm_atomic_helper_page_flip, > .reset = drm_atomic_helper_crtc_reset, > .set_config = drm_atomic_helper_set_config, > + .enable_vblank = fsl_dcu_drm_crtc_enable_vblank, > + .disable_vblank = fsl_dcu_drm_crtc_disable_vblank, > }; > > int fsl_dcu_drm_crtc_create(struct fsl_dcu_drm_device *fsl_dev) > diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c > b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c > index b59b816a1d7d..b5391c124c64 100644 > --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c > +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c > @@ -154,29 +154,6 @@ static irqreturn_t fsl_dcu_drm_irq(int irq, void *arg) > return IRQ_HANDLED; > } > > -static int fsl_dcu_drm_enable_vblank(struct drm_device *dev, unsigned int pipe) > -{ > - struct fsl_dcu_drm_device *fsl_dev = dev->dev_private; > - unsigned int value; > - > - regmap_read(fsl_dev->regmap, DCU_INT_MASK, &value); > - value &= ~DCU_INT_MASK_VBLANK; > - regmap_write(fsl_dev->regmap, DCU_INT_MASK, value); > - > - return 0; > -} > - > -static void fsl_dcu_drm_disable_vblank(struct drm_device *dev, > - unsigned int pipe) > -{ > - struct fsl_dcu_drm_device *fsl_dev = dev->dev_private; > - unsigned int value; > - > - regmap_read(fsl_dev->regmap, DCU_INT_MASK, &value); > - value |= DCU_INT_MASK_VBLANK; > - regmap_write(fsl_dev->regmap, DCU_INT_MASK, value); > -} > - > static void fsl_dcu_drm_lastclose(struct drm_device *dev) > { > struct fsl_dcu_drm_device *fsl_dev = dev->dev_private; > @@ -203,8 +180,6 @@ static void fsl_dcu_drm_lastclose(struct drm_device *dev) > .load = fsl_dcu_load, > .unload = fsl_dcu_unload, > .irq_handler = fsl_dcu_drm_irq, > - .enable_vblank = fsl_dcu_drm_enable_vblank, > - .disable_vblank = fsl_dcu_drm_disable_vblank, > .gem_free_object_unlocked = drm_gem_cma_free_object, > .gem_vm_ops = &drm_gem_cma_vm_ops, > .prime_handle_to_fd = drm_gem_prime_handle_to_fd,
On Tue, Feb 07, 2017 at 09:01:22PM -0800, Stefan Agner wrote: > On 2017-02-07 01: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. > > > > Signed-off-by: Shawn Guo <shawn.guo@linaro.org> > > Cc: Stefan Agner <stefan@agner.ch> > > Acked-by: Stefan Agner <stefan@agner.ch> Merged up to this one to drm-misc for 4.12, I'll give the others some more time for maintainer acks. -Daniel > > > --- > > drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c | 26 ++++++++++++++++++++++++++ > > drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 25 ------------------------- > > 2 files changed, 26 insertions(+), 25 deletions(-) > > > > diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c > > b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c > > index deb57435cc89..cc4e944a1d3c 100644 > > --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c > > +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c > > @@ -137,6 +137,30 @@ static void fsl_dcu_drm_crtc_mode_set_nofb(struct > > drm_crtc *crtc) > > .mode_set_nofb = fsl_dcu_drm_crtc_mode_set_nofb, > > }; > > > > +static int fsl_dcu_drm_crtc_enable_vblank(struct drm_crtc *crtc) > > +{ > > + struct drm_device *dev = crtc->dev; > > + struct fsl_dcu_drm_device *fsl_dev = dev->dev_private; > > + unsigned int value; > > + > > + regmap_read(fsl_dev->regmap, DCU_INT_MASK, &value); > > + value &= ~DCU_INT_MASK_VBLANK; > > + regmap_write(fsl_dev->regmap, DCU_INT_MASK, value); > > + > > + return 0; > > +} > > + > > +static void fsl_dcu_drm_crtc_disable_vblank(struct drm_crtc *crtc) > > +{ > > + struct drm_device *dev = crtc->dev; > > + struct fsl_dcu_drm_device *fsl_dev = dev->dev_private; > > + unsigned int value; > > + > > + regmap_read(fsl_dev->regmap, DCU_INT_MASK, &value); > > + value |= DCU_INT_MASK_VBLANK; > > + regmap_write(fsl_dev->regmap, DCU_INT_MASK, value); > > +} > > + > > static const struct drm_crtc_funcs fsl_dcu_drm_crtc_funcs = { > > .atomic_duplicate_state = drm_atomic_helper_crtc_duplicate_state, > > .atomic_destroy_state = drm_atomic_helper_crtc_destroy_state, > > @@ -144,6 +168,8 @@ static void fsl_dcu_drm_crtc_mode_set_nofb(struct > > drm_crtc *crtc) > > .page_flip = drm_atomic_helper_page_flip, > > .reset = drm_atomic_helper_crtc_reset, > > .set_config = drm_atomic_helper_set_config, > > + .enable_vblank = fsl_dcu_drm_crtc_enable_vblank, > > + .disable_vblank = fsl_dcu_drm_crtc_disable_vblank, > > }; > > > > int fsl_dcu_drm_crtc_create(struct fsl_dcu_drm_device *fsl_dev) > > diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c > > b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c > > index b59b816a1d7d..b5391c124c64 100644 > > --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c > > +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c > > @@ -154,29 +154,6 @@ static irqreturn_t fsl_dcu_drm_irq(int irq, void *arg) > > return IRQ_HANDLED; > > } > > > > -static int fsl_dcu_drm_enable_vblank(struct drm_device *dev, unsigned int pipe) > > -{ > > - struct fsl_dcu_drm_device *fsl_dev = dev->dev_private; > > - unsigned int value; > > - > > - regmap_read(fsl_dev->regmap, DCU_INT_MASK, &value); > > - value &= ~DCU_INT_MASK_VBLANK; > > - regmap_write(fsl_dev->regmap, DCU_INT_MASK, value); > > - > > - return 0; > > -} > > - > > -static void fsl_dcu_drm_disable_vblank(struct drm_device *dev, > > - unsigned int pipe) > > -{ > > - struct fsl_dcu_drm_device *fsl_dev = dev->dev_private; > > - unsigned int value; > > - > > - regmap_read(fsl_dev->regmap, DCU_INT_MASK, &value); > > - value |= DCU_INT_MASK_VBLANK; > > - regmap_write(fsl_dev->regmap, DCU_INT_MASK, value); > > -} > > - > > static void fsl_dcu_drm_lastclose(struct drm_device *dev) > > { > > struct fsl_dcu_drm_device *fsl_dev = dev->dev_private; > > @@ -203,8 +180,6 @@ static void fsl_dcu_drm_lastclose(struct drm_device *dev) > > .load = fsl_dcu_load, > > .unload = fsl_dcu_unload, > > .irq_handler = fsl_dcu_drm_irq, > > - .enable_vblank = fsl_dcu_drm_enable_vblank, > > - .disable_vblank = fsl_dcu_drm_disable_vblank, > > .gem_free_object_unlocked = drm_gem_cma_free_object, > > .gem_vm_ops = &drm_gem_cma_vm_ops, > > .prime_handle_to_fd = drm_gem_prime_handle_to_fd,
diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c index deb57435cc89..cc4e944a1d3c 100644 --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c @@ -137,6 +137,30 @@ static void fsl_dcu_drm_crtc_mode_set_nofb(struct drm_crtc *crtc) .mode_set_nofb = fsl_dcu_drm_crtc_mode_set_nofb, }; +static int fsl_dcu_drm_crtc_enable_vblank(struct drm_crtc *crtc) +{ + struct drm_device *dev = crtc->dev; + struct fsl_dcu_drm_device *fsl_dev = dev->dev_private; + unsigned int value; + + regmap_read(fsl_dev->regmap, DCU_INT_MASK, &value); + value &= ~DCU_INT_MASK_VBLANK; + regmap_write(fsl_dev->regmap, DCU_INT_MASK, value); + + return 0; +} + +static void fsl_dcu_drm_crtc_disable_vblank(struct drm_crtc *crtc) +{ + struct drm_device *dev = crtc->dev; + struct fsl_dcu_drm_device *fsl_dev = dev->dev_private; + unsigned int value; + + regmap_read(fsl_dev->regmap, DCU_INT_MASK, &value); + value |= DCU_INT_MASK_VBLANK; + regmap_write(fsl_dev->regmap, DCU_INT_MASK, value); +} + static const struct drm_crtc_funcs fsl_dcu_drm_crtc_funcs = { .atomic_duplicate_state = drm_atomic_helper_crtc_duplicate_state, .atomic_destroy_state = drm_atomic_helper_crtc_destroy_state, @@ -144,6 +168,8 @@ static void fsl_dcu_drm_crtc_mode_set_nofb(struct drm_crtc *crtc) .page_flip = drm_atomic_helper_page_flip, .reset = drm_atomic_helper_crtc_reset, .set_config = drm_atomic_helper_set_config, + .enable_vblank = fsl_dcu_drm_crtc_enable_vblank, + .disable_vblank = fsl_dcu_drm_crtc_disable_vblank, }; int fsl_dcu_drm_crtc_create(struct fsl_dcu_drm_device *fsl_dev) diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c index b59b816a1d7d..b5391c124c64 100644 --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c @@ -154,29 +154,6 @@ static irqreturn_t fsl_dcu_drm_irq(int irq, void *arg) return IRQ_HANDLED; } -static int fsl_dcu_drm_enable_vblank(struct drm_device *dev, unsigned int pipe) -{ - struct fsl_dcu_drm_device *fsl_dev = dev->dev_private; - unsigned int value; - - regmap_read(fsl_dev->regmap, DCU_INT_MASK, &value); - value &= ~DCU_INT_MASK_VBLANK; - regmap_write(fsl_dev->regmap, DCU_INT_MASK, value); - - return 0; -} - -static void fsl_dcu_drm_disable_vblank(struct drm_device *dev, - unsigned int pipe) -{ - struct fsl_dcu_drm_device *fsl_dev = dev->dev_private; - unsigned int value; - - regmap_read(fsl_dev->regmap, DCU_INT_MASK, &value); - value |= DCU_INT_MASK_VBLANK; - regmap_write(fsl_dev->regmap, DCU_INT_MASK, value); -} - static void fsl_dcu_drm_lastclose(struct drm_device *dev) { struct fsl_dcu_drm_device *fsl_dev = dev->dev_private; @@ -203,8 +180,6 @@ static void fsl_dcu_drm_lastclose(struct drm_device *dev) .load = fsl_dcu_load, .unload = fsl_dcu_unload, .irq_handler = fsl_dcu_drm_irq, - .enable_vblank = fsl_dcu_drm_enable_vblank, - .disable_vblank = fsl_dcu_drm_disable_vblank, .gem_free_object_unlocked = drm_gem_cma_free_object, .gem_vm_ops = &drm_gem_cma_vm_ops, .prime_handle_to_fd = drm_gem_prime_handle_to_fd,