Skip to content

Commit

Permalink
drm/imx: Remove local fbdev emulation Kconfig option
Browse files Browse the repository at this point in the history
DRM_IMX_FB_HELPER config is currently used to enable/disable fbdev
emulation for the imx kms driver.

Remove this local config option and use the top level DRM_FBDEV_EMULATION
config option where applicable. Using this config lets us also prevent
wrapping around drm_fb_helper_* calls with #ifdefs in certain places.

Tested-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Archit Taneja <architt@codeaurora.org>
Link: http://patchwork.freedesktop.org/patch/msgid/1445933459-5249-2-git-send-email-architt@codeaurora.org
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
  • Loading branch information
Archit Taneja authored and Daniel Vetter committed Nov 24, 2015
1 parent df2e090 commit c1ff5a7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 18 deletions.
9 changes: 0 additions & 9 deletions drivers/gpu/drm/imx/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,6 @@ config DRM_IMX
help
enable i.MX graphics support

config DRM_IMX_FB_HELPER
tristate "provide legacy framebuffer /dev/fb0"
select DRM_KMS_CMA_HELPER
depends on DRM_IMX
help
The DRM framework can provide a legacy /dev/fb0 framebuffer
for your device. This is necessary to get a framebuffer console
and also for applications using the legacy framebuffer API

config DRM_IMX_PARALLEL_DISPLAY
tristate "Support for parallel displays"
select DRM_PANEL
Expand Down
12 changes: 3 additions & 9 deletions drivers/gpu/drm/imx/imx-drm-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,10 @@ struct imx_drm_crtc {
struct imx_drm_crtc_helper_funcs imx_drm_helper_funcs;
};

#if IS_ENABLED(CONFIG_DRM_FBDEV_EMULATION)
static int legacyfb_depth = 16;
module_param(legacyfb_depth, int, 0444);
#endif

int imx_drm_crtc_id(struct imx_drm_crtc *crtc)
{
Expand All @@ -60,26 +62,20 @@ EXPORT_SYMBOL_GPL(imx_drm_crtc_id);

static void imx_drm_driver_lastclose(struct drm_device *drm)
{
#if IS_ENABLED(CONFIG_DRM_IMX_FB_HELPER)
struct imx_drm_device *imxdrm = drm->dev_private;

if (imxdrm->fbhelper)
drm_fbdev_cma_restore_mode(imxdrm->fbhelper);
#endif
}

static int imx_drm_driver_unload(struct drm_device *drm)
{
#if IS_ENABLED(CONFIG_DRM_IMX_FB_HELPER)
struct imx_drm_device *imxdrm = drm->dev_private;
#endif

drm_kms_helper_poll_fini(drm);

#if IS_ENABLED(CONFIG_DRM_IMX_FB_HELPER)
if (imxdrm->fbhelper)
drm_fbdev_cma_fini(imxdrm->fbhelper);
#endif

component_unbind_all(drm->dev, drm);

Expand Down Expand Up @@ -215,11 +211,9 @@ EXPORT_SYMBOL_GPL(imx_drm_encoder_destroy);

static void imx_drm_output_poll_changed(struct drm_device *drm)
{
#if IS_ENABLED(CONFIG_DRM_IMX_FB_HELPER)
struct imx_drm_device *imxdrm = drm->dev_private;

drm_fbdev_cma_hotplug_event(imxdrm->fbhelper);
#endif
}

static struct drm_mode_config_funcs imx_drm_mode_config_funcs = {
Expand Down Expand Up @@ -308,7 +302,7 @@ static int imx_drm_driver_load(struct drm_device *drm, unsigned long flags)
* The fb helper takes copies of key hardware information, so the
* crtcs/connectors/encoders must not change after this point.
*/
#if IS_ENABLED(CONFIG_DRM_IMX_FB_HELPER)
#if IS_ENABLED(CONFIG_DRM_FBDEV_EMULATION)
if (legacyfb_depth != 16 && legacyfb_depth != 32) {
dev_warn(drm->dev, "Invalid legacyfb_depth. Defaulting to 16bpp\n");
legacyfb_depth = 16;
Expand Down

0 comments on commit c1ff5a7

Please sign in to comment.