Skip to content
Snippets Groups Projects
Commit 10b3ea61 authored by Guido Gunther's avatar Guido Gunther :zzz: Committed by Angus Ainslie (Purism)
Browse files

imx-drm-core: Switch to drm_fb_generic_setup


like in f53705fd

Signed-off-by: default avatarGuido Günther <guido.gunther@puri.sm>
parent 993c7e3e
No related branches found
No related tags found
6 merge requests!101Adjust the pin control register values of each SDA and SCL pin,!82USB: Add USB_QUIRK_RESET_RESUME quirk for Microchip USB2642,!71Make I2C1 operate at 387kHz,!66Purism redpine driver,!54Drop capacity,!44WIP power: bq25890_charger: Indicate charging state
......@@ -25,13 +25,6 @@
#include "imx-drm.h"
#include "dcss-crtc.h"
static void dcss_drm_output_poll_changed(struct drm_device *drm)
{
struct imx_drm_device *imxdrm = drm->dev_private;
drm_fbdev_cma_hotplug_event(imxdrm->fbhelper);
}
static int dcss_drm_atomic_check(struct drm_device *drm,
struct drm_atomic_state *state)
{
......@@ -126,7 +119,6 @@ static void dcss_drm_atomic_commit_tail(struct drm_atomic_state *state)
const struct drm_mode_config_funcs dcss_drm_mode_config_funcs = {
.fb_create = drm_gem_fb_create,
.output_poll_changed = dcss_drm_output_poll_changed,
.atomic_check = dcss_drm_atomic_check,
.atomic_commit = dcss_drm_atomic_commit,
};
......
......@@ -46,13 +46,6 @@ static int legacyfb_depth = 16;
module_param(legacyfb_depth, int, 0444);
#endif
static void imx_drm_driver_lastclose(struct drm_device *drm)
{
struct imx_drm_device *imxdrm = drm->dev_private;
drm_fbdev_cma_restore_mode(imxdrm->fbhelper);
}
static int imx_drm_enable_vblank(struct drm_device *drm, unsigned int pipe)
{
struct imx_drm_device *imxdrm = drm->dev_private;
......@@ -204,7 +197,6 @@ static const struct drm_ioctl_desc imx_drm_ioctls[] = {
static struct drm_driver imx_drm_driver = {
.driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_PRIME |
DRIVER_ATOMIC,
.lastclose = imx_drm_driver_lastclose,
.gem_free_object_unlocked = drm_gem_cma_free_object,
.gem_vm_ops = &drm_gem_cma_vm_ops,
.dumb_create = drm_gem_cma_dumb_create,
......@@ -360,7 +352,6 @@ static int imx_drm_bind(struct device *dev)
* 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_FBDEV_EMULATION)
if (legacyfb_depth != 16 && legacyfb_depth != 32) {
dev_warn(dev, "Invalid legacyfb_depth. Defaulting to 16bpp\n");
legacyfb_depth = 16;
......@@ -369,29 +360,18 @@ static int imx_drm_bind(struct device *dev)
if (legacyfb_depth == 16 && has_dcss(dev))
legacyfb_depth = 32;
imxdrm->fbhelper = drm_fbdev_cma_init(drm, legacyfb_depth, MAX_CRTC);
if (IS_ERR(imxdrm->fbhelper)) {
ret = PTR_ERR(imxdrm->fbhelper);
imxdrm->fbhelper = NULL;
goto err_unbind;
}
#endif
drm_kms_helper_poll_init(drm);
ret = drm_dev_register(drm, 0);
if (ret)
goto err_fbhelper;
goto err_poll_fini;
drm_fbdev_generic_setup(drm, legacyfb_depth);
return 0;
err_fbhelper:
err_poll_fini:
drm_kms_helper_poll_fini(drm);
#if IS_ENABLED(CONFIG_DRM_FBDEV_EMULATION)
if (imxdrm->fbhelper)
drm_fbdev_cma_fini(imxdrm->fbhelper);
err_unbind:
#endif
component_unbind_all(drm->dev, drm);
err_kms:
drm_mode_config_cleanup(drm);
......@@ -404,15 +384,11 @@ static int imx_drm_bind(struct device *dev)
static void imx_drm_unbind(struct device *dev)
{
struct drm_device *drm = dev_get_drvdata(dev);
struct imx_drm_device *imxdrm = drm->dev_private;
drm_dev_unregister(drm);
drm_kms_helper_poll_fini(drm);
if (imxdrm->fbhelper)
drm_fbdev_cma_fini(imxdrm->fbhelper);
drm_mode_config_cleanup(drm);
component_unbind_all(drm->dev, drm);
......
......@@ -9,7 +9,6 @@ struct drm_connector;
struct drm_device;
struct drm_display_mode;
struct drm_encoder;
struct drm_fbdev_cma;
struct drm_framebuffer;
struct drm_plane;
struct imx_drm_crtc;
......@@ -19,7 +18,6 @@ struct imx_drm_device {
struct drm_device *drm;
struct imx_drm_crtc *crtc[MAX_CRTC];
unsigned int pipes;
struct drm_fbdev_cma *fbhelper;
struct drm_atomic_state *state;
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment