Skip to content

Commit

Permalink
drm/fsl-dcu: implement lastclose callback
Browse files Browse the repository at this point in the history
Use CMA helper drm_fbdev_cma_restore_mode to restore fbdev mode
in process which uses drm/kms dies.

Signed-off-by: Stefan Agner <stefan@agner.ch>
  • Loading branch information
Stefan Agner committed Apr 26, 2016
1 parent 7d17a62 commit 9a15da1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,13 @@ static void fsl_dcu_drm_disable_vblank(struct drm_device *dev,
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;

drm_fbdev_cma_restore_mode(fsl_dev->fbdev);
}

static const struct file_operations fsl_dcu_drm_fops = {
.owner = THIS_MODULE,
.open = drm_open,
Expand All @@ -185,6 +192,7 @@ static const struct file_operations fsl_dcu_drm_fops = {
static struct drm_driver fsl_dcu_drm_driver = {
.driver_features = DRIVER_HAVE_IRQ | DRIVER_GEM | DRIVER_MODESET
| DRIVER_PRIME | DRIVER_ATOMIC,
.lastclose = fsl_dcu_drm_lastclose,
.load = fsl_dcu_load,
.unload = fsl_dcu_unload,
.irq_handler = fsl_dcu_drm_irq,
Expand Down

0 comments on commit 9a15da1

Please sign in to comment.