Skip to content

Commit

Permalink
Merge tag 'drm-fsl-dcu-for-next' of http://git.agner.ch/git/linux-drm…
Browse files Browse the repository at this point in the history
…-fsl-dcu into drm-next

Some fixes and cleanup, mainly around fbdev emulation. It also adds a
new module parameter which allows to specify the color depth/bpp for
the fbdev emulation (like the IMX DRM driver).

* tag 'drm-fsl-dcu-for-next' of http://git.agner.ch/git/linux-drm-fsl-dcu:
  drm/fsl-dcu: introduce kernel parameter to specify fbdev depth
  drm/fsl-dcu: remove separate compilation unit for fbdev emulation
  drm/fsl-dcu: Propagate the real error code
  drm/fsl-dcu: Remove unneeded NULL check
  drm/fsl-dcu: disable outputs before unloading driver
  drm/fsl-dcu: unload driver before disabling clocks
  • Loading branch information
Dave Airlie committed Dec 9, 2016
2 parents acc5ddd + 73fe26a commit 25dfd7c
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 33 deletions.
1 change: 0 additions & 1 deletion drivers/gpu/drm/fsl-dcu/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@ fsl-dcu-drm-y := fsl_dcu_drm_drv.o \
fsl_dcu_drm_rgb.o \
fsl_dcu_drm_plane.o \
fsl_dcu_drm_crtc.o \
fsl_dcu_drm_fbdev.o \
fsl_tcon.o
obj-$(CONFIG_DRM_FSL_DCU) += fsl-dcu-drm.o
26 changes: 18 additions & 8 deletions drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
#include "fsl_dcu_drm_drv.h"
#include "fsl_tcon.h"

static int legacyfb_depth = 24;
module_param(legacyfb_depth, int, 0444);

static bool fsl_dcu_drm_is_volatile_reg(struct device *dev, unsigned int reg)
{
if (reg == DCU_INT_STATUS || reg == DCU_UPDATE_MODE)
Expand Down Expand Up @@ -85,7 +88,18 @@ static int fsl_dcu_load(struct drm_device *dev, unsigned long flags)
goto done;
dev->irq_enabled = true;

fsl_dcu_fbdev_init(dev);
if (legacyfb_depth != 16 && legacyfb_depth != 24 &&
legacyfb_depth != 32) {
dev_warn(dev->dev,
"Invalid legacyfb_depth. Defaulting to 24bpp\n");
legacyfb_depth = 24;
}
fsl_dev->fbdev = drm_fbdev_cma_init(dev, legacyfb_depth, 1, 1);
if (IS_ERR(fsl_dev->fbdev)) {
ret = PTR_ERR(fsl_dev->fbdev);
fsl_dev->fbdev = NULL;
goto done;
}

return 0;
done:
Expand All @@ -106,6 +120,7 @@ static int fsl_dcu_unload(struct drm_device *dev)
{
struct fsl_dcu_drm_device *fsl_dev = dev->dev_private;

drm_crtc_force_disable_all(dev);
drm_kms_helper_poll_fini(dev);

if (fsl_dev->fbdev)
Expand Down Expand Up @@ -332,11 +347,6 @@ static int fsl_dcu_drm_probe(struct platform_device *pdev)
fsl_dev->soc = id->data;

res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
dev_err(dev, "could not get memory IO resource\n");
return -ENODEV;
}

base = devm_ioremap_resource(dev, res);
if (IS_ERR(base)) {
ret = PTR_ERR(base);
Expand All @@ -346,7 +356,7 @@ static int fsl_dcu_drm_probe(struct platform_device *pdev)
fsl_dev->irq = platform_get_irq(pdev, 0);
if (fsl_dev->irq < 0) {
dev_err(dev, "failed to get irq\n");
return -ENXIO;
return fsl_dev->irq;
}

fsl_dev->regmap = devm_regmap_init_mmio(dev, base,
Expand Down Expand Up @@ -424,9 +434,9 @@ static int fsl_dcu_drm_remove(struct platform_device *pdev)
{
struct fsl_dcu_drm_device *fsl_dev = platform_get_drvdata(pdev);

drm_put_dev(fsl_dev->drm);
clk_disable_unprepare(fsl_dev->clk);
clk_unregister(fsl_dev->pix_clk);
drm_put_dev(fsl_dev->drm);

return 0;
}
Expand Down
1 change: 0 additions & 1 deletion drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ struct fsl_dcu_drm_device {
struct drm_atomic_state *state;
};

void fsl_dcu_fbdev_init(struct drm_device *dev);
int fsl_dcu_drm_modeset_init(struct fsl_dcu_drm_device *fsl_dev);

#endif /* __FSL_DCU_DRM_DRV_H__ */
23 changes: 0 additions & 23 deletions drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_fbdev.c

This file was deleted.

0 comments on commit 25dfd7c

Please sign in to comment.