2011-10-04 18:19:01 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2011 Samsung Electronics Co., Ltd.
|
|
|
|
* Authors:
|
|
|
|
* Inki Dae <inki.dae@samsung.com>
|
|
|
|
* Joonyoung Shim <jy0922.shim@samsung.com>
|
|
|
|
* Seung-Woo Kim <sw0312.kim@samsung.com>
|
|
|
|
*
|
2012-12-18 01:30:17 +08:00
|
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU General Public License as published by the
|
|
|
|
* Free Software Foundation; either version 2 of the License, or (at your
|
|
|
|
* option) any later version.
|
2011-10-04 18:19:01 +08:00
|
|
|
*/
|
|
|
|
|
2014-01-31 05:19:27 +08:00
|
|
|
#include <linux/pm_runtime.h>
|
2012-10-03 01:01:07 +08:00
|
|
|
#include <drm/drmP.h>
|
2015-08-16 00:26:17 +08:00
|
|
|
#include <drm/drm_atomic.h>
|
|
|
|
#include <drm/drm_atomic_helper.h>
|
2012-10-03 01:01:07 +08:00
|
|
|
#include <drm/drm_crtc_helper.h>
|
2017-12-06 02:24:57 +08:00
|
|
|
#include <drm/drm_fb_helper.h>
|
2011-10-04 18:19:01 +08:00
|
|
|
|
2014-05-09 13:25:20 +08:00
|
|
|
#include <linux/component.h>
|
2013-12-20 18:16:24 +08:00
|
|
|
|
2011-10-04 18:19:01 +08:00
|
|
|
#include <drm/exynos_drm.h>
|
|
|
|
|
|
|
|
#include "exynos_drm_drv.h"
|
|
|
|
#include "exynos_drm_fbdev.h"
|
|
|
|
#include "exynos_drm_fb.h"
|
|
|
|
#include "exynos_drm_gem.h"
|
2011-12-08 16:54:07 +08:00
|
|
|
#include "exynos_drm_plane.h"
|
drm/exynos: ipp: Add IPP v2 framework
This patch adds Exynos IPP v2 subsystem and userspace API.
New userspace API is focused ONLY on memory-to-memory image processing.
The two remainging operation modes of obsolete IPP v1 API (framebuffer
writeback and local-path output with image processing) can be implemented
using standard DRM features: writeback connectors and additional DRM planes
with scaling features.
V2 IPP userspace API is based on stateless approach, which much better fits
to memory-to-memory image processing model. It also provides support for
all image formats, which are both already defined in DRM API and supported
by the existing IPP hardware modules.
The API consists of the following ioctls:
- DRM_IOCTL_EXYNOS_IPP_GET_RESOURCES: to enumerate all available image
processing modules,
- DRM_IOCTL_EXYNOS_IPP_GET_CAPS: to query capabilities and supported image
formats of given IPP module,
- DRM_IOCTL_EXYNOS_IPP_GET_LIMITS: to query hardware limitiations for
selected image format of given IPP module,
- DRM_IOCTL_EXYNOS_IPP_COMMIT: to perform operation described by the
provided structures (source and destination buffers, operation rectangle,
transformation, etc).
The proposed userspace API is extensible. In the future more advanced image
processing operations can be defined to support for example blending.
Userspace API is fully functional also on DRM render nodes, so it is not
limited to the root/privileged client.
Internal driver API also has been completely rewritten. New IPP core
performs all possible input validation, checks and object life-time
control. The drivers can focus only on writing configuration to hardware
registers. Stateless nature of DRM_IOCTL_EXYNOS_IPP_COMMIT ioctl simplifies
the driver API. Minimal driver needs to provide a single callback for
starting processing and an array with supported image formats.
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Tested-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
Merge conflict so merged manually.
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2018-05-10 07:46:36 +08:00
|
|
|
#include "exynos_drm_ipp.h"
|
2012-03-21 09:55:26 +08:00
|
|
|
#include "exynos_drm_vidi.h"
|
2012-05-17 19:06:32 +08:00
|
|
|
#include "exynos_drm_g2d.h"
|
2012-10-20 22:53:42 +08:00
|
|
|
#include "exynos_drm_iommu.h"
|
2011-10-04 18:19:01 +08:00
|
|
|
|
2011-12-15 16:31:24 +08:00
|
|
|
#define DRIVER_NAME "exynos"
|
2011-10-04 18:19:01 +08:00
|
|
|
#define DRIVER_DESC "Samsung SoC DRM"
|
drm/exynos: ipp: Add IPP v2 framework
This patch adds Exynos IPP v2 subsystem and userspace API.
New userspace API is focused ONLY on memory-to-memory image processing.
The two remainging operation modes of obsolete IPP v1 API (framebuffer
writeback and local-path output with image processing) can be implemented
using standard DRM features: writeback connectors and additional DRM planes
with scaling features.
V2 IPP userspace API is based on stateless approach, which much better fits
to memory-to-memory image processing model. It also provides support for
all image formats, which are both already defined in DRM API and supported
by the existing IPP hardware modules.
The API consists of the following ioctls:
- DRM_IOCTL_EXYNOS_IPP_GET_RESOURCES: to enumerate all available image
processing modules,
- DRM_IOCTL_EXYNOS_IPP_GET_CAPS: to query capabilities and supported image
formats of given IPP module,
- DRM_IOCTL_EXYNOS_IPP_GET_LIMITS: to query hardware limitiations for
selected image format of given IPP module,
- DRM_IOCTL_EXYNOS_IPP_COMMIT: to perform operation described by the
provided structures (source and destination buffers, operation rectangle,
transformation, etc).
The proposed userspace API is extensible. In the future more advanced image
processing operations can be defined to support for example blending.
Userspace API is fully functional also on DRM render nodes, so it is not
limited to the root/privileged client.
Internal driver API also has been completely rewritten. New IPP core
performs all possible input validation, checks and object life-time
control. The drivers can focus only on writing configuration to hardware
registers. Stateless nature of DRM_IOCTL_EXYNOS_IPP_COMMIT ioctl simplifies
the driver API. Minimal driver needs to provide a single callback for
starting processing and an array with supported image formats.
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Tested-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
Merge conflict so merged manually.
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2018-05-10 07:46:36 +08:00
|
|
|
#define DRIVER_DATE "20180330"
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Interface history:
|
|
|
|
*
|
|
|
|
* 1.0 - Original version
|
|
|
|
* 1.1 - Upgrade IPP driver to version 2.0
|
|
|
|
*/
|
2011-10-04 18:19:01 +08:00
|
|
|
#define DRIVER_MAJOR 1
|
drm/exynos: ipp: Add IPP v2 framework
This patch adds Exynos IPP v2 subsystem and userspace API.
New userspace API is focused ONLY on memory-to-memory image processing.
The two remainging operation modes of obsolete IPP v1 API (framebuffer
writeback and local-path output with image processing) can be implemented
using standard DRM features: writeback connectors and additional DRM planes
with scaling features.
V2 IPP userspace API is based on stateless approach, which much better fits
to memory-to-memory image processing model. It also provides support for
all image formats, which are both already defined in DRM API and supported
by the existing IPP hardware modules.
The API consists of the following ioctls:
- DRM_IOCTL_EXYNOS_IPP_GET_RESOURCES: to enumerate all available image
processing modules,
- DRM_IOCTL_EXYNOS_IPP_GET_CAPS: to query capabilities and supported image
formats of given IPP module,
- DRM_IOCTL_EXYNOS_IPP_GET_LIMITS: to query hardware limitiations for
selected image format of given IPP module,
- DRM_IOCTL_EXYNOS_IPP_COMMIT: to perform operation described by the
provided structures (source and destination buffers, operation rectangle,
transformation, etc).
The proposed userspace API is extensible. In the future more advanced image
processing operations can be defined to support for example blending.
Userspace API is fully functional also on DRM render nodes, so it is not
limited to the root/privileged client.
Internal driver API also has been completely rewritten. New IPP core
performs all possible input validation, checks and object life-time
control. The drivers can focus only on writing configuration to hardware
registers. Stateless nature of DRM_IOCTL_EXYNOS_IPP_COMMIT ioctl simplifies
the driver API. Minimal driver needs to provide a single callback for
starting processing and an array with supported image formats.
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Tested-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
Merge conflict so merged manually.
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2018-05-10 07:46:36 +08:00
|
|
|
#define DRIVER_MINOR 1
|
2011-10-04 18:19:01 +08:00
|
|
|
|
2016-10-10 22:50:56 +08:00
|
|
|
int exynos_atomic_check(struct drm_device *dev,
|
|
|
|
struct drm_atomic_state *state)
|
|
|
|
{
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
ret = drm_atomic_helper_check_modeset(dev, state);
|
|
|
|
if (ret)
|
|
|
|
return ret;
|
|
|
|
|
|
|
|
ret = drm_atomic_normalize_zpos(dev, state);
|
|
|
|
if (ret)
|
|
|
|
return ret;
|
|
|
|
|
|
|
|
ret = drm_atomic_helper_check_planes(dev, state);
|
|
|
|
if (ret)
|
|
|
|
return ret;
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2012-03-16 17:47:09 +08:00
|
|
|
static int exynos_drm_open(struct drm_device *dev, struct drm_file *file)
|
|
|
|
{
|
2012-05-17 19:06:32 +08:00
|
|
|
struct drm_exynos_file_private *file_priv;
|
2013-07-01 16:00:47 +08:00
|
|
|
int ret;
|
2012-05-17 19:06:32 +08:00
|
|
|
|
|
|
|
file_priv = kzalloc(sizeof(*file_priv), GFP_KERNEL);
|
|
|
|
if (!file_priv)
|
|
|
|
return -ENOMEM;
|
|
|
|
|
|
|
|
file->driver_priv = file_priv;
|
2012-04-23 20:01:28 +08:00
|
|
|
|
2013-07-01 16:00:47 +08:00
|
|
|
ret = exynos_drm_subdrv_open(dev, file);
|
2014-01-16 14:01:26 +08:00
|
|
|
if (ret)
|
2014-03-17 11:28:06 +08:00
|
|
|
goto err_file_priv_free;
|
2013-07-01 16:00:47 +08:00
|
|
|
|
2014-01-16 14:01:26 +08:00
|
|
|
return ret;
|
2014-03-17 11:28:06 +08:00
|
|
|
|
|
|
|
err_file_priv_free:
|
2014-01-16 14:01:26 +08:00
|
|
|
kfree(file_priv);
|
|
|
|
file->driver_priv = NULL;
|
2013-07-01 16:00:47 +08:00
|
|
|
return ret;
|
2012-03-16 17:47:09 +08:00
|
|
|
}
|
|
|
|
|
2013-10-01 13:51:37 +08:00
|
|
|
static void exynos_drm_postclose(struct drm_device *dev, struct drm_file *file)
|
2011-10-14 12:29:51 +08:00
|
|
|
{
|
2017-05-08 16:26:32 +08:00
|
|
|
exynos_drm_subdrv_close(dev, file);
|
2012-02-15 10:25:22 +08:00
|
|
|
kfree(file->driver_priv);
|
|
|
|
file->driver_priv = NULL;
|
|
|
|
}
|
|
|
|
|
2012-05-17 19:27:22 +08:00
|
|
|
static const struct vm_operations_struct exynos_drm_gem_vm_ops = {
|
2011-10-04 18:19:01 +08:00
|
|
|
.fault = exynos_drm_gem_fault,
|
|
|
|
.open = drm_gem_vm_open,
|
|
|
|
.close = drm_gem_vm_close,
|
|
|
|
};
|
|
|
|
|
2013-08-03 01:27:49 +08:00
|
|
|
static const struct drm_ioctl_desc exynos_ioctls[] = {
|
2011-10-04 18:19:01 +08:00
|
|
|
DRM_IOCTL_DEF_DRV(EXYNOS_GEM_CREATE, exynos_drm_gem_create_ioctl,
|
2015-09-08 19:56:30 +08:00
|
|
|
DRM_AUTH | DRM_RENDER_ALLOW),
|
2016-03-08 13:12:59 +08:00
|
|
|
DRM_IOCTL_DEF_DRV(EXYNOS_GEM_MAP, exynos_drm_gem_map_ioctl,
|
|
|
|
DRM_AUTH | DRM_RENDER_ALLOW),
|
2015-08-30 23:45:56 +08:00
|
|
|
DRM_IOCTL_DEF_DRV(EXYNOS_GEM_GET, exynos_drm_gem_get_ioctl,
|
2015-09-08 19:56:30 +08:00
|
|
|
DRM_RENDER_ALLOW),
|
2015-08-30 23:45:56 +08:00
|
|
|
DRM_IOCTL_DEF_DRV(EXYNOS_VIDI_CONNECTION, vidi_connection_ioctl,
|
2015-09-08 19:56:30 +08:00
|
|
|
DRM_AUTH),
|
2015-08-30 23:45:56 +08:00
|
|
|
DRM_IOCTL_DEF_DRV(EXYNOS_G2D_GET_VER, exynos_g2d_get_ver_ioctl,
|
2015-09-08 19:56:30 +08:00
|
|
|
DRM_AUTH | DRM_RENDER_ALLOW),
|
2015-08-30 23:45:56 +08:00
|
|
|
DRM_IOCTL_DEF_DRV(EXYNOS_G2D_SET_CMDLIST, exynos_g2d_set_cmdlist_ioctl,
|
2015-09-08 19:56:30 +08:00
|
|
|
DRM_AUTH | DRM_RENDER_ALLOW),
|
2015-08-30 23:45:56 +08:00
|
|
|
DRM_IOCTL_DEF_DRV(EXYNOS_G2D_EXEC, exynos_g2d_exec_ioctl,
|
2015-09-08 19:56:30 +08:00
|
|
|
DRM_AUTH | DRM_RENDER_ALLOW),
|
drm/exynos: ipp: Add IPP v2 framework
This patch adds Exynos IPP v2 subsystem and userspace API.
New userspace API is focused ONLY on memory-to-memory image processing.
The two remainging operation modes of obsolete IPP v1 API (framebuffer
writeback and local-path output with image processing) can be implemented
using standard DRM features: writeback connectors and additional DRM planes
with scaling features.
V2 IPP userspace API is based on stateless approach, which much better fits
to memory-to-memory image processing model. It also provides support for
all image formats, which are both already defined in DRM API and supported
by the existing IPP hardware modules.
The API consists of the following ioctls:
- DRM_IOCTL_EXYNOS_IPP_GET_RESOURCES: to enumerate all available image
processing modules,
- DRM_IOCTL_EXYNOS_IPP_GET_CAPS: to query capabilities and supported image
formats of given IPP module,
- DRM_IOCTL_EXYNOS_IPP_GET_LIMITS: to query hardware limitiations for
selected image format of given IPP module,
- DRM_IOCTL_EXYNOS_IPP_COMMIT: to perform operation described by the
provided structures (source and destination buffers, operation rectangle,
transformation, etc).
The proposed userspace API is extensible. In the future more advanced image
processing operations can be defined to support for example blending.
Userspace API is fully functional also on DRM render nodes, so it is not
limited to the root/privileged client.
Internal driver API also has been completely rewritten. New IPP core
performs all possible input validation, checks and object life-time
control. The drivers can focus only on writing configuration to hardware
registers. Stateless nature of DRM_IOCTL_EXYNOS_IPP_COMMIT ioctl simplifies
the driver API. Minimal driver needs to provide a single callback for
starting processing and an array with supported image formats.
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Tested-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
Merge conflict so merged manually.
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2018-05-10 07:46:36 +08:00
|
|
|
DRM_IOCTL_DEF_DRV(EXYNOS_IPP_GET_RESOURCES,
|
|
|
|
exynos_drm_ipp_get_res_ioctl,
|
|
|
|
DRM_AUTH | DRM_RENDER_ALLOW),
|
|
|
|
DRM_IOCTL_DEF_DRV(EXYNOS_IPP_GET_CAPS, exynos_drm_ipp_get_caps_ioctl,
|
|
|
|
DRM_AUTH | DRM_RENDER_ALLOW),
|
|
|
|
DRM_IOCTL_DEF_DRV(EXYNOS_IPP_GET_LIMITS,
|
|
|
|
exynos_drm_ipp_get_limits_ioctl,
|
|
|
|
DRM_AUTH | DRM_RENDER_ALLOW),
|
|
|
|
DRM_IOCTL_DEF_DRV(EXYNOS_IPP_COMMIT, exynos_drm_ipp_commit_ioctl,
|
|
|
|
DRM_AUTH | DRM_RENDER_ALLOW),
|
2011-10-04 18:19:01 +08:00
|
|
|
};
|
|
|
|
|
2011-12-08 14:00:20 +08:00
|
|
|
static const struct file_operations exynos_drm_driver_fops = {
|
|
|
|
.owner = THIS_MODULE,
|
|
|
|
.open = drm_open,
|
|
|
|
.mmap = exynos_drm_gem_mmap,
|
|
|
|
.poll = drm_poll,
|
|
|
|
.read = drm_read,
|
|
|
|
.unlocked_ioctl = drm_ioctl,
|
2012-07-10 06:40:07 +08:00
|
|
|
.compat_ioctl = drm_compat_ioctl,
|
2011-12-08 14:00:20 +08:00
|
|
|
.release = drm_release,
|
|
|
|
};
|
|
|
|
|
2011-10-04 18:19:01 +08:00
|
|
|
static struct drm_driver exynos_drm_driver = {
|
2015-08-24 19:52:19 +08:00
|
|
|
.driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_PRIME
|
2015-08-30 23:45:56 +08:00
|
|
|
| DRIVER_ATOMIC | DRIVER_RENDER,
|
2012-03-16 17:47:09 +08:00
|
|
|
.open = exynos_drm_open,
|
2017-12-06 02:24:57 +08:00
|
|
|
.lastclose = drm_fb_helper_lastclose,
|
2012-02-15 10:25:22 +08:00
|
|
|
.postclose = exynos_drm_postclose,
|
2016-04-27 01:29:50 +08:00
|
|
|
.gem_free_object_unlocked = exynos_drm_gem_free_object,
|
2011-10-04 18:19:01 +08:00
|
|
|
.gem_vm_ops = &exynos_drm_gem_vm_ops,
|
|
|
|
.dumb_create = exynos_drm_gem_dumb_create,
|
2012-04-23 20:01:28 +08:00
|
|
|
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
|
|
|
|
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
|
2015-08-16 13:33:08 +08:00
|
|
|
.gem_prime_export = drm_gem_prime_export,
|
2017-10-30 15:28:09 +08:00
|
|
|
.gem_prime_import = exynos_drm_gem_prime_import,
|
2015-08-16 13:33:08 +08:00
|
|
|
.gem_prime_get_sg_table = exynos_drm_gem_prime_get_sg_table,
|
|
|
|
.gem_prime_import_sg_table = exynos_drm_gem_prime_import_sg_table,
|
|
|
|
.gem_prime_vmap = exynos_drm_gem_prime_vmap,
|
|
|
|
.gem_prime_vunmap = exynos_drm_gem_prime_vunmap,
|
2016-04-22 15:30:47 +08:00
|
|
|
.gem_prime_mmap = exynos_drm_gem_prime_mmap,
|
2011-10-04 18:19:01 +08:00
|
|
|
.ioctls = exynos_ioctls,
|
2013-08-03 01:27:49 +08:00
|
|
|
.num_ioctls = ARRAY_SIZE(exynos_ioctls),
|
2011-12-08 14:00:20 +08:00
|
|
|
.fops = &exynos_drm_driver_fops,
|
2011-10-04 18:19:01 +08:00
|
|
|
.name = DRIVER_NAME,
|
|
|
|
.desc = DRIVER_DESC,
|
|
|
|
.date = DRIVER_DATE,
|
|
|
|
.major = DRIVER_MAJOR,
|
|
|
|
.minor = DRIVER_MINOR,
|
|
|
|
};
|
|
|
|
|
2014-01-31 05:19:27 +08:00
|
|
|
#ifdef CONFIG_PM_SLEEP
|
2015-11-27 22:32:45 +08:00
|
|
|
static int exynos_drm_suspend(struct device *dev)
|
2014-01-31 05:19:27 +08:00
|
|
|
{
|
|
|
|
struct drm_device *drm_dev = dev_get_drvdata(dev);
|
2017-10-09 16:43:53 +08:00
|
|
|
struct exynos_drm_private *private;
|
2014-01-31 05:19:27 +08:00
|
|
|
|
2014-06-30 21:25:44 +08:00
|
|
|
if (pm_runtime_suspended(dev) || !drm_dev)
|
2014-01-31 05:19:27 +08:00
|
|
|
return 0;
|
|
|
|
|
2017-10-09 16:43:53 +08:00
|
|
|
private = drm_dev->dev_private;
|
|
|
|
|
2017-09-14 20:01:01 +08:00
|
|
|
drm_kms_helper_poll_disable(drm_dev);
|
|
|
|
exynos_drm_fbdev_suspend(drm_dev);
|
|
|
|
private->suspend_state = drm_atomic_helper_suspend(drm_dev);
|
|
|
|
if (IS_ERR(private->suspend_state)) {
|
|
|
|
exynos_drm_fbdev_resume(drm_dev);
|
|
|
|
drm_kms_helper_poll_enable(drm_dev);
|
|
|
|
return PTR_ERR(private->suspend_state);
|
2015-11-27 22:32:45 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
2014-01-31 05:19:27 +08:00
|
|
|
}
|
|
|
|
|
2015-11-27 22:32:45 +08:00
|
|
|
static int exynos_drm_resume(struct device *dev)
|
2014-01-31 05:19:27 +08:00
|
|
|
{
|
|
|
|
struct drm_device *drm_dev = dev_get_drvdata(dev);
|
2017-10-09 16:43:53 +08:00
|
|
|
struct exynos_drm_private *private;
|
2014-01-31 05:19:27 +08:00
|
|
|
|
2014-06-30 21:25:44 +08:00
|
|
|
if (pm_runtime_suspended(dev) || !drm_dev)
|
2014-01-31 05:19:27 +08:00
|
|
|
return 0;
|
|
|
|
|
2017-10-09 16:43:53 +08:00
|
|
|
private = drm_dev->dev_private;
|
2017-09-14 20:01:01 +08:00
|
|
|
drm_atomic_helper_resume(drm_dev, private->suspend_state);
|
|
|
|
exynos_drm_fbdev_resume(drm_dev);
|
|
|
|
drm_kms_helper_poll_enable(drm_dev);
|
2015-11-27 22:32:45 +08:00
|
|
|
|
|
|
|
return 0;
|
2014-01-31 05:19:27 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
static const struct dev_pm_ops exynos_drm_pm_ops = {
|
2015-11-27 22:32:45 +08:00
|
|
|
SET_SYSTEM_SLEEP_PM_OPS(exynos_drm_suspend, exynos_drm_resume)
|
2014-01-31 05:19:27 +08:00
|
|
|
};
|
|
|
|
|
2015-06-11 22:23:37 +08:00
|
|
|
/* forward declaration */
|
|
|
|
static struct platform_driver exynos_drm_platform_driver;
|
2014-05-09 13:25:20 +08:00
|
|
|
|
2016-02-18 21:34:16 +08:00
|
|
|
struct exynos_drm_driver_info {
|
|
|
|
struct platform_driver *driver;
|
|
|
|
unsigned int flags;
|
|
|
|
};
|
|
|
|
|
|
|
|
#define DRM_COMPONENT_DRIVER BIT(0) /* supports component framework */
|
|
|
|
#define DRM_VIRTUAL_DEVICE BIT(1) /* create virtual platform device */
|
2016-02-29 16:50:53 +08:00
|
|
|
#define DRM_DMA_DEVICE BIT(2) /* can be used for dma allocations */
|
2016-02-18 21:34:16 +08:00
|
|
|
|
|
|
|
#define DRV_PTR(drv, cond) (IS_ENABLED(cond) ? &drv : NULL)
|
|
|
|
|
2015-06-11 22:23:37 +08:00
|
|
|
/*
|
|
|
|
* Connector drivers should not be placed before associated crtc drivers,
|
|
|
|
* because connector requires pipe number of its crtc during initialization.
|
|
|
|
*/
|
2016-02-18 21:34:16 +08:00
|
|
|
static struct exynos_drm_driver_info exynos_drm_drivers[] = {
|
|
|
|
{
|
|
|
|
DRV_PTR(fimd_driver, CONFIG_DRM_EXYNOS_FIMD),
|
2016-02-29 16:50:53 +08:00
|
|
|
DRM_COMPONENT_DRIVER | DRM_DMA_DEVICE
|
2016-02-18 21:34:16 +08:00
|
|
|
}, {
|
|
|
|
DRV_PTR(exynos5433_decon_driver, CONFIG_DRM_EXYNOS5433_DECON),
|
2016-02-29 16:50:53 +08:00
|
|
|
DRM_COMPONENT_DRIVER | DRM_DMA_DEVICE
|
2016-02-18 21:34:16 +08:00
|
|
|
}, {
|
|
|
|
DRV_PTR(decon_driver, CONFIG_DRM_EXYNOS7_DECON),
|
2016-02-29 16:50:53 +08:00
|
|
|
DRM_COMPONENT_DRIVER | DRM_DMA_DEVICE
|
2016-02-18 21:34:16 +08:00
|
|
|
}, {
|
|
|
|
DRV_PTR(mixer_driver, CONFIG_DRM_EXYNOS_MIXER),
|
2016-02-29 16:50:53 +08:00
|
|
|
DRM_COMPONENT_DRIVER | DRM_DMA_DEVICE
|
2016-02-18 21:34:16 +08:00
|
|
|
}, {
|
|
|
|
DRV_PTR(mic_driver, CONFIG_DRM_EXYNOS_MIC),
|
|
|
|
DRM_COMPONENT_DRIVER
|
|
|
|
}, {
|
|
|
|
DRV_PTR(dp_driver, CONFIG_DRM_EXYNOS_DP),
|
|
|
|
DRM_COMPONENT_DRIVER
|
|
|
|
}, {
|
|
|
|
DRV_PTR(dsi_driver, CONFIG_DRM_EXYNOS_DSI),
|
|
|
|
DRM_COMPONENT_DRIVER
|
|
|
|
}, {
|
|
|
|
DRV_PTR(hdmi_driver, CONFIG_DRM_EXYNOS_HDMI),
|
|
|
|
DRM_COMPONENT_DRIVER
|
|
|
|
}, {
|
|
|
|
DRV_PTR(vidi_driver, CONFIG_DRM_EXYNOS_VIDI),
|
|
|
|
DRM_COMPONENT_DRIVER | DRM_VIRTUAL_DEVICE
|
|
|
|
}, {
|
|
|
|
DRV_PTR(g2d_driver, CONFIG_DRM_EXYNOS_G2D),
|
|
|
|
}, {
|
|
|
|
DRV_PTR(fimc_driver, CONFIG_DRM_EXYNOS_FIMC),
|
|
|
|
}, {
|
|
|
|
DRV_PTR(rotator_driver, CONFIG_DRM_EXYNOS_ROTATOR),
|
2018-05-09 16:59:23 +08:00
|
|
|
DRM_COMPONENT_DRIVER
|
2016-02-18 21:34:16 +08:00
|
|
|
}, {
|
|
|
|
DRV_PTR(gsc_driver, CONFIG_DRM_EXYNOS_GSC),
|
|
|
|
}, {
|
|
|
|
&exynos_drm_platform_driver,
|
|
|
|
DRM_VIRTUAL_DEVICE
|
|
|
|
}
|
2015-06-11 22:23:37 +08:00
|
|
|
};
|
2014-05-09 13:25:20 +08:00
|
|
|
|
2014-09-11 16:04:03 +08:00
|
|
|
static int compare_dev(struct device *dev, void *data)
|
2014-05-09 13:25:20 +08:00
|
|
|
{
|
|
|
|
return dev == (struct device *)data;
|
|
|
|
}
|
|
|
|
|
2014-09-11 16:04:03 +08:00
|
|
|
static struct component_match *exynos_drm_match_add(struct device *dev)
|
2014-05-09 13:25:20 +08:00
|
|
|
{
|
2014-09-11 16:04:03 +08:00
|
|
|
struct component_match *match = NULL;
|
2015-06-11 22:23:37 +08:00
|
|
|
int i;
|
2014-05-09 13:25:20 +08:00
|
|
|
|
2016-02-18 21:34:16 +08:00
|
|
|
for (i = 0; i < ARRAY_SIZE(exynos_drm_drivers); ++i) {
|
|
|
|
struct exynos_drm_driver_info *info = &exynos_drm_drivers[i];
|
2015-06-11 22:23:37 +08:00
|
|
|
struct device *p = NULL, *d;
|
2014-11-06 22:00:37 +08:00
|
|
|
|
2016-02-18 21:34:16 +08:00
|
|
|
if (!info->driver || !(info->flags & DRM_COMPONENT_DRIVER))
|
|
|
|
continue;
|
|
|
|
|
|
|
|
while ((d = bus_find_device(&platform_bus_type, p,
|
|
|
|
&info->driver->driver,
|
2015-06-11 22:23:37 +08:00
|
|
|
(void *)platform_bus_type.match))) {
|
|
|
|
put_device(p);
|
|
|
|
component_match_add(dev, &match, compare_dev, d);
|
|
|
|
p = d;
|
2014-05-29 17:28:02 +08:00
|
|
|
}
|
2015-06-11 22:23:37 +08:00
|
|
|
put_device(p);
|
2014-05-09 13:25:20 +08:00
|
|
|
}
|
|
|
|
|
2015-06-11 22:23:37 +08:00
|
|
|
return match ?: ERR_PTR(-ENODEV);
|
2014-05-09 13:25:20 +08:00
|
|
|
}
|
|
|
|
|
2017-11-23 17:27:57 +08:00
|
|
|
static struct device *exynos_drm_get_dma_device(void)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = 0; i < ARRAY_SIZE(exynos_drm_drivers); ++i) {
|
|
|
|
struct exynos_drm_driver_info *info = &exynos_drm_drivers[i];
|
|
|
|
struct device *dev;
|
|
|
|
|
|
|
|
if (!info->driver || !(info->flags & DRM_DMA_DEVICE))
|
|
|
|
continue;
|
|
|
|
|
|
|
|
while ((dev = bus_find_device(&platform_bus_type, NULL,
|
|
|
|
&info->driver->driver,
|
|
|
|
(void *)platform_bus_type.match))) {
|
|
|
|
put_device(dev);
|
|
|
|
return dev;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2014-05-09 13:25:20 +08:00
|
|
|
static int exynos_drm_bind(struct device *dev)
|
|
|
|
{
|
2016-12-12 17:28:47 +08:00
|
|
|
struct exynos_drm_private *private;
|
|
|
|
struct drm_encoder *encoder;
|
|
|
|
struct drm_device *drm;
|
|
|
|
unsigned int clone_mask;
|
|
|
|
int cnt, ret;
|
|
|
|
|
|
|
|
drm = drm_dev_alloc(&exynos_drm_driver, dev);
|
|
|
|
if (IS_ERR(drm))
|
|
|
|
return PTR_ERR(drm);
|
|
|
|
|
|
|
|
private = kzalloc(sizeof(struct exynos_drm_private), GFP_KERNEL);
|
|
|
|
if (!private) {
|
|
|
|
ret = -ENOMEM;
|
|
|
|
goto err_free_drm;
|
|
|
|
}
|
|
|
|
|
|
|
|
init_waitqueue_head(&private->wait);
|
|
|
|
spin_lock_init(&private->lock);
|
|
|
|
|
|
|
|
dev_set_drvdata(dev, drm);
|
|
|
|
drm->dev_private = (void *)private;
|
|
|
|
|
|
|
|
/* the first real CRTC device is used for all dma mapping operations */
|
|
|
|
private->dma_dev = exynos_drm_get_dma_device();
|
|
|
|
if (!private->dma_dev) {
|
|
|
|
DRM_ERROR("no device found for DMA mapping operations.\n");
|
|
|
|
ret = -ENODEV;
|
|
|
|
goto err_free_private;
|
|
|
|
}
|
|
|
|
DRM_INFO("Exynos DRM: using %s device for DMA mapping operations\n",
|
|
|
|
dev_name(private->dma_dev));
|
|
|
|
|
|
|
|
/* create common IOMMU mapping for all devices attached to Exynos DRM */
|
|
|
|
ret = drm_create_iommu_mapping(drm);
|
|
|
|
if (ret < 0) {
|
|
|
|
DRM_ERROR("failed to create iommu mapping.\n");
|
|
|
|
goto err_free_private;
|
|
|
|
}
|
|
|
|
|
|
|
|
drm_mode_config_init(drm);
|
|
|
|
|
|
|
|
exynos_drm_mode_config_init(drm);
|
|
|
|
|
|
|
|
/* setup possible_clones. */
|
|
|
|
cnt = 0;
|
|
|
|
clone_mask = 0;
|
|
|
|
list_for_each_entry(encoder, &drm->mode_config.encoder_list, head)
|
|
|
|
clone_mask |= (1 << (cnt++));
|
|
|
|
|
|
|
|
list_for_each_entry(encoder, &drm->mode_config.encoder_list, head)
|
|
|
|
encoder->possible_clones = clone_mask;
|
|
|
|
|
|
|
|
/* Try to bind all sub drivers. */
|
|
|
|
ret = component_bind_all(drm->dev, drm);
|
|
|
|
if (ret)
|
|
|
|
goto err_mode_config_cleanup;
|
|
|
|
|
|
|
|
ret = drm_vblank_init(drm, drm->mode_config.num_crtc);
|
|
|
|
if (ret)
|
|
|
|
goto err_unbind_all;
|
|
|
|
|
|
|
|
/* Probe non kms sub drivers and virtual display driver. */
|
|
|
|
ret = exynos_drm_device_subdrv_probe(drm);
|
|
|
|
if (ret)
|
2017-05-24 22:51:53 +08:00
|
|
|
goto err_unbind_all;
|
2016-12-12 17:28:47 +08:00
|
|
|
|
|
|
|
drm_mode_config_reset(drm);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* enable drm irq mode.
|
|
|
|
* - with irq_enabled = true, we can use the vblank feature.
|
|
|
|
*
|
|
|
|
* P.S. note that we wouldn't use drm irq handler but
|
|
|
|
* just specific driver own one instead because
|
|
|
|
* drm framework supports only one irq handler.
|
|
|
|
*/
|
|
|
|
drm->irq_enabled = true;
|
|
|
|
|
|
|
|
/* init kms poll for handling hpd */
|
|
|
|
drm_kms_helper_poll_init(drm);
|
|
|
|
|
2017-07-06 21:00:22 +08:00
|
|
|
ret = exynos_drm_fbdev_init(drm);
|
|
|
|
if (ret)
|
|
|
|
goto err_cleanup_poll;
|
2016-12-12 17:28:47 +08:00
|
|
|
|
|
|
|
/* register the DRM device */
|
|
|
|
ret = drm_dev_register(drm, 0);
|
|
|
|
if (ret < 0)
|
|
|
|
goto err_cleanup_fbdev;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
err_cleanup_fbdev:
|
|
|
|
exynos_drm_fbdev_fini(drm);
|
2017-07-06 21:00:22 +08:00
|
|
|
err_cleanup_poll:
|
2016-12-12 17:28:47 +08:00
|
|
|
drm_kms_helper_poll_fini(drm);
|
|
|
|
exynos_drm_device_subdrv_remove(drm);
|
|
|
|
err_unbind_all:
|
|
|
|
component_unbind_all(drm->dev, drm);
|
|
|
|
err_mode_config_cleanup:
|
|
|
|
drm_mode_config_cleanup(drm);
|
|
|
|
drm_release_iommu_mapping(drm);
|
|
|
|
err_free_private:
|
|
|
|
kfree(private);
|
|
|
|
err_free_drm:
|
|
|
|
drm_dev_unref(drm);
|
|
|
|
|
|
|
|
return ret;
|
2014-05-09 13:25:20 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void exynos_drm_unbind(struct device *dev)
|
|
|
|
{
|
2016-12-12 17:28:47 +08:00
|
|
|
struct drm_device *drm = dev_get_drvdata(dev);
|
|
|
|
|
|
|
|
drm_dev_unregister(drm);
|
|
|
|
|
|
|
|
exynos_drm_device_subdrv_remove(drm);
|
|
|
|
|
|
|
|
exynos_drm_fbdev_fini(drm);
|
|
|
|
drm_kms_helper_poll_fini(drm);
|
|
|
|
|
|
|
|
component_unbind_all(drm->dev, drm);
|
|
|
|
drm_mode_config_cleanup(drm);
|
|
|
|
drm_release_iommu_mapping(drm);
|
|
|
|
|
|
|
|
kfree(drm->dev_private);
|
|
|
|
drm->dev_private = NULL;
|
2017-10-09 16:44:01 +08:00
|
|
|
dev_set_drvdata(dev, NULL);
|
2016-12-12 17:28:47 +08:00
|
|
|
|
|
|
|
drm_dev_unref(drm);
|
2014-05-09 13:25:20 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static const struct component_master_ops exynos_drm_ops = {
|
|
|
|
.bind = exynos_drm_bind,
|
|
|
|
.unbind = exynos_drm_unbind,
|
2011-10-04 18:19:01 +08:00
|
|
|
};
|
|
|
|
|
2015-06-11 22:20:52 +08:00
|
|
|
static int exynos_drm_platform_probe(struct platform_device *pdev)
|
|
|
|
{
|
|
|
|
struct component_match *match;
|
|
|
|
|
|
|
|
pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
|
|
|
|
|
|
|
|
match = exynos_drm_match_add(&pdev->dev);
|
|
|
|
if (IS_ERR(match))
|
|
|
|
return PTR_ERR(match);
|
|
|
|
|
|
|
|
return component_master_add_with_match(&pdev->dev, &exynos_drm_ops,
|
|
|
|
match);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int exynos_drm_platform_remove(struct platform_device *pdev)
|
|
|
|
{
|
|
|
|
component_master_del(&pdev->dev, &exynos_drm_ops);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static struct platform_driver exynos_drm_platform_driver = {
|
|
|
|
.probe = exynos_drm_platform_probe,
|
|
|
|
.remove = exynos_drm_platform_remove,
|
|
|
|
.driver = {
|
|
|
|
.name = "exynos-drm",
|
|
|
|
.pm = &exynos_drm_pm_ops,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
static void exynos_drm_unregister_devices(void)
|
2014-11-13 15:37:57 +08:00
|
|
|
{
|
2016-02-18 21:34:16 +08:00
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = ARRAY_SIZE(exynos_drm_drivers) - 1; i >= 0; --i) {
|
|
|
|
struct exynos_drm_driver_info *info = &exynos_drm_drivers[i];
|
|
|
|
struct device *dev;
|
2014-03-17 18:27:17 +08:00
|
|
|
|
2016-02-18 21:34:16 +08:00
|
|
|
if (!info->driver || !(info->flags & DRM_VIRTUAL_DEVICE))
|
|
|
|
continue;
|
|
|
|
|
|
|
|
while ((dev = bus_find_device(&platform_bus_type, NULL,
|
|
|
|
&info->driver->driver,
|
|
|
|
(void *)platform_bus_type.match))) {
|
|
|
|
put_device(dev);
|
|
|
|
platform_device_unregister(to_platform_device(dev));
|
|
|
|
}
|
2015-06-11 22:20:52 +08:00
|
|
|
}
|
|
|
|
}
|
2014-04-04 00:19:56 +08:00
|
|
|
|
2015-06-11 22:20:52 +08:00
|
|
|
static int exynos_drm_register_devices(void)
|
|
|
|
{
|
2016-02-18 21:34:16 +08:00
|
|
|
struct platform_device *pdev;
|
2015-06-11 22:20:52 +08:00
|
|
|
int i;
|
|
|
|
|
2016-02-18 21:34:16 +08:00
|
|
|
for (i = 0; i < ARRAY_SIZE(exynos_drm_drivers); ++i) {
|
|
|
|
struct exynos_drm_driver_info *info = &exynos_drm_drivers[i];
|
2015-06-11 22:20:52 +08:00
|
|
|
|
2016-02-18 21:34:16 +08:00
|
|
|
if (!info->driver || !(info->flags & DRM_VIRTUAL_DEVICE))
|
2015-06-11 22:20:52 +08:00
|
|
|
continue;
|
|
|
|
|
2016-02-18 21:34:16 +08:00
|
|
|
pdev = platform_device_register_simple(
|
|
|
|
info->driver->driver.name, -1, NULL, 0);
|
|
|
|
if (IS_ERR(pdev))
|
|
|
|
goto fail;
|
2014-11-13 15:37:57 +08:00
|
|
|
}
|
2014-05-09 13:25:20 +08:00
|
|
|
|
2015-06-11 22:20:52 +08:00
|
|
|
return 0;
|
2016-02-18 21:34:16 +08:00
|
|
|
fail:
|
|
|
|
exynos_drm_unregister_devices();
|
|
|
|
return PTR_ERR(pdev);
|
2011-10-04 18:19:01 +08:00
|
|
|
}
|
|
|
|
|
2016-02-18 21:34:16 +08:00
|
|
|
static void exynos_drm_unregister_drivers(void)
|
2011-10-04 18:19:01 +08:00
|
|
|
{
|
2016-02-18 21:34:16 +08:00
|
|
|
int i;
|
2015-06-11 22:20:52 +08:00
|
|
|
|
2016-02-18 21:34:16 +08:00
|
|
|
for (i = ARRAY_SIZE(exynos_drm_drivers) - 1; i >= 0; --i) {
|
|
|
|
struct exynos_drm_driver_info *info = &exynos_drm_drivers[i];
|
2015-06-11 22:20:52 +08:00
|
|
|
|
2016-02-18 21:34:16 +08:00
|
|
|
if (!info->driver)
|
2015-06-11 22:20:52 +08:00
|
|
|
continue;
|
|
|
|
|
2016-02-18 21:34:16 +08:00
|
|
|
platform_driver_unregister(info->driver);
|
2015-06-11 22:20:52 +08:00
|
|
|
}
|
2014-05-09 13:25:20 +08:00
|
|
|
}
|
|
|
|
|
2016-02-18 21:34:16 +08:00
|
|
|
static int exynos_drm_register_drivers(void)
|
2015-06-11 22:20:52 +08:00
|
|
|
{
|
2016-02-18 21:34:16 +08:00
|
|
|
int i, ret;
|
2015-06-11 22:20:52 +08:00
|
|
|
|
2016-02-18 21:34:16 +08:00
|
|
|
for (i = 0; i < ARRAY_SIZE(exynos_drm_drivers); ++i) {
|
|
|
|
struct exynos_drm_driver_info *info = &exynos_drm_drivers[i];
|
2015-06-11 22:20:52 +08:00
|
|
|
|
2016-02-18 21:34:16 +08:00
|
|
|
if (!info->driver)
|
|
|
|
continue;
|
2015-06-11 22:20:52 +08:00
|
|
|
|
2016-02-18 21:34:16 +08:00
|
|
|
ret = platform_driver_register(info->driver);
|
|
|
|
if (ret)
|
|
|
|
goto fail;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
fail:
|
|
|
|
exynos_drm_unregister_drivers();
|
|
|
|
return ret;
|
2015-06-11 22:20:52 +08:00
|
|
|
}
|
|
|
|
|
2014-05-09 13:25:20 +08:00
|
|
|
static int exynos_drm_init(void)
|
|
|
|
{
|
2015-06-08 18:15:42 +08:00
|
|
|
int ret;
|
2014-05-09 13:25:20 +08:00
|
|
|
|
2015-06-11 22:20:52 +08:00
|
|
|
ret = exynos_drm_register_devices();
|
|
|
|
if (ret)
|
|
|
|
return ret;
|
drm/exynos: move Exynos platform drivers registration to init
Registering the Exynos DRM subdevices platform drivers in the probe
function is causing an infinite loop. Fix this by moving it to the
exynos_drm_init() function to register the drivers on module init.
Registering drivers in the probe functions causes a deadlock in the parent
device lock. See Grant Likely explanation on the topic:
"I think the problem is that exynos_drm_init() is registering a normal
(non-OF) platform device, so the parent will be /sys/devices/platform.
It immediately gets bound against exynos_drm_platform_driver which
calls the exynos drm_platform_probe() hook. The driver core obtains
device_lock() on the device *and on the device parent*.
Inside the probe hook, additional platform_drivers get registered.
Each time one does, it tries to bind against every platform device in
the system, which includes the ones created by OF. When it attempts to
bind, it obtains device_lock() on the device *and on the device
parent*.
Before the change to move of-generated platform devices into
/sys/devices/platform, the devices had different parents. Now both
devices have /sys/devices/platform as the parent, so yes they are
going to deadlock.
The real problem is registering drivers from within a probe hook. That
is completely wrong for the above deadlock reason. __driver_attach()
will deadlock. Those registrations must be pulled out of .probe().
Registering devices in .probe() is okay because __device_attach()
doesn't try to obtain device_lock() on the parent."
INFO: task swapper/0:1 blocked for more than 120 seconds.
Not tainted 3.18.0-rc3-next-20141105 #794
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
swapper/0 D c052534c 0 1 0 0x00000000
[<c052534c>] (__schedule) from [<c0525b34>] (schedule_preempt_disabled+0x14/0x20)
[<c0525b34>] (schedule_preempt_disabled) from [<c0526d44>] (mutex_lock_nested+0x1c4/0x464
[<c0526d44>] (mutex_lock_nested) from [<c02be908>] (__driver_attach+0x48/0x98)
[<c02be908>] (__driver_attach) from [<c02bcc00>] (bus_for_each_dev+0x54/0x88)
[<c02bcc00>] (bus_for_each_dev) from [<c02bdce0>] (bus_add_driver+0xe4/0x200)
[<c02bdce0>] (bus_add_driver) from [<c02bef94>] (driver_register+0x78/0xf4)
[<c02bef94>] (driver_register) from [<c029e99c>] (exynos_drm_platform_probe+0x34/0x234)
[<c029e99c>] (exynos_drm_platform_probe) from [<c02bfcf0>] (platform_drv_probe+0x48/0xa4)
[<c02bfcf0>] (platform_drv_probe) from [<c02be680>] (driver_probe_device+0x13c/0x37c)
[<c02be680>] (driver_probe_device) from [<c02be954>] (__driver_attach+0x94/0x98)
[<c02be954>] (__driver_attach) from [<c02bcc00>] (bus_for_each_dev+0x54/0x88)
[<c02bcc00>] (bus_for_each_dev) from [<c02bdce0>] (bus_add_driver+0xe4/0x200)
[<c02bdce0>] (bus_add_driver) from [<c02bef94>] (driver_register+0x78/0xf4)
[<c02bef94>] (driver_register) from [<c029e938>] (exynos_drm_init+0x70/0xa0)
[<c029e938>] (exynos_drm_init) from [<c00089b0>] (do_one_initcall+0xac/0x1f0)
[<c00089b0>] (do_one_initcall) from [<c074bd90>] (kernel_init_freeable+0x10c/0x1d8)
[<c074bd90>] (kernel_init_freeable) from [<c051eabc>] (kernel_init+0x8/0xec)
[<c051eabc>] (kernel_init) from [<c000f268>] (ret_from_fork+0x14/0x2c)
3 locks held by swapper/0/1:
#0: (&dev->mutex){......}, at: [<c02be908>] __driver_attach+0x48/0x98
#1: (&dev->mutex){......}, at: [<c02be918>] __driver_attach+0x58/0x98
#2: (&dev->mutex){......}, at: [<c02be908>] __driver_attach+0x48/0x98
Changelog v2:
- call platform_driver_register after all kms and non kms drivers are
registered
- rebased it to exynos-drm-next
Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-11-24 15:37:26 +08:00
|
|
|
|
2016-02-18 21:34:16 +08:00
|
|
|
ret = exynos_drm_register_drivers();
|
2015-06-11 22:20:52 +08:00
|
|
|
if (ret)
|
|
|
|
goto err_unregister_pdevs;
|
2014-05-09 13:25:20 +08:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
2015-06-11 22:20:52 +08:00
|
|
|
err_unregister_pdevs:
|
|
|
|
exynos_drm_unregister_devices();
|
2014-05-09 13:25:20 +08:00
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void exynos_drm_exit(void)
|
|
|
|
{
|
2016-02-18 21:34:16 +08:00
|
|
|
exynos_drm_unregister_drivers();
|
2015-06-11 22:20:52 +08:00
|
|
|
exynos_drm_unregister_devices();
|
2011-10-04 18:19:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
module_init(exynos_drm_init);
|
|
|
|
module_exit(exynos_drm_exit);
|
|
|
|
|
|
|
|
MODULE_AUTHOR("Inki Dae <inki.dae@samsung.com>");
|
|
|
|
MODULE_AUTHOR("Joonyoung Shim <jy0922.shim@samsung.com>");
|
|
|
|
MODULE_AUTHOR("Seung-Woo Kim <sw0312.kim@samsung.com>");
|
|
|
|
MODULE_DESCRIPTION("Samsung SoC DRM Driver");
|
|
|
|
MODULE_LICENSE("GPL");
|