drm_object_attach_property(&crtc->base, prop, 0);
}
-int exynos_drm_crtc_create(struct exynos_drm_manager *manager, int pipe)
+int exynos_drm_crtc_create(struct exynos_drm_manager *manager, int pipe,
+ enum exynos_drm_output_type type)
{
struct exynos_drm_crtc *exynos_crtc;
struct drm_plane *plane;
exynos_crtc->dpms = DRM_MODE_DPMS_OFF;
exynos_crtc->manager = manager;
exynos_crtc->pipe = pipe;
+ exynos_crtc->type = type;
plane = exynos_plane_init(manager->drm_dev, 1 << pipe,
DRM_PLANE_TYPE_PRIMARY);
if (IS_ERR(plane)) {
struct exynos_drm_crtc *exynos_crtc;
exynos_crtc = to_exynos_crtc(crtc);
- if (exynos_crtc->manager->type == out_type)
+ if (exynos_crtc->type == out_type)
return exynos_crtc->pipe;
}
#include "exynos_drm_drv.h"
-int exynos_drm_crtc_create(struct exynos_drm_manager *manager, int pipe);
+int exynos_drm_crtc_create(struct exynos_drm_manager *manager, int pipe,
+ enum exynos_drm_output_type type);
int exynos_drm_crtc_enable_vblank(struct drm_device *dev, int pipe);
void exynos_drm_crtc_disable_vblank(struct drm_device *dev, int pipe);
void exynos_drm_crtc_finish_pageflip(struct drm_device *dev, int pipe);
* Exynos drm common manager structure, maps 1:1 with a crtc
*
* @list: the list entry for this manager
- * @type: one of EXYNOS_DISPLAY_TYPE_LCD and HDMI.
* @drm_dev: pointer to the drm device
* @crtc: crtc object.
* @ops: pointer to callbacks for exynos drm specific functionality
*/
struct exynos_drm_manager {
struct list_head list;
- enum exynos_drm_output_type type;
struct drm_device *drm_dev;
struct drm_crtc *crtc;
struct exynos_drm_manager_ops *ops;
*
* @base: crtc object.
* @manager: the manager associated with this crtc
+ * @type: one of EXYNOS_DISPLAY_TYPE_LCD and HDMI.
* @pipe: a crtc index created at load() with a new crtc object creation
* and the crtc object would be set to private->crtc array
* to get a crtc object corresponding to this pipe from private->crtc
struct exynos_drm_crtc {
struct drm_crtc base;
struct exynos_drm_manager *manager;
+ enum exynos_drm_output_type type;
unsigned int pipe;
unsigned int dpms;
enum exynos_crtc_mode mode;
struct drm_device *drm_dev = data;
fimd_mgr_initialize(&ctx->manager, drm_dev);
- exynos_drm_crtc_create(&ctx->manager, ctx->pipe);
+ exynos_drm_crtc_create(&ctx->manager, ctx->pipe,
+ EXYNOS_DISPLAY_TYPE_LCD);
if (ctx->display)
exynos_drm_create_enc_conn(drm_dev, ctx->display);
if (!ctx)
return -ENOMEM;
- ctx->manager.type = EXYNOS_DISPLAY_TYPE_LCD;
ctx->manager.ops = &fimd_manager_ops;
ret = exynos_drm_component_add(dev, EXYNOS_DEVICE_TYPE_CRTC,
- ctx->manager.type);
+ EXYNOS_DISPLAY_TYPE_LCD);
if (ret)
return ret;
vidi_mgr_initialize(&ctx->manager, drm_dev);
- ret = exynos_drm_crtc_create(&ctx->manager, ctx->pipe);
+ ret = exynos_drm_crtc_create(&ctx->manager, ctx->pipe,
+ EXYNOS_DISPLAY_TYPE_VIDI);
if (ret) {
DRM_ERROR("failed to create crtc.\n");
return ret;
if (!ctx)
return -ENOMEM;
- ctx->manager.type = EXYNOS_DISPLAY_TYPE_VIDI;
ctx->manager.ops = &vidi_manager_ops;
ctx->display.type = EXYNOS_DISPLAY_TYPE_VIDI;
ctx->display.ops = &vidi_display_ops;
ctx->pdev = pdev;
ret = exynos_drm_component_add(&pdev->dev, EXYNOS_DEVICE_TYPE_CRTC,
- ctx->manager.type);
+ EXYNOS_DISPLAY_TYPE_VIDI);
if (ret)
return ret;
if (ret)
return ret;
- ret = exynos_drm_crtc_create(&ctx->manager, ctx->pipe);
+ ret = exynos_drm_crtc_create(&ctx->manager, ctx->pipe,
+ EXYNOS_DISPLAY_TYPE_HDMI);
if (ret) {
mixer_mgr_remove(&ctx->manager);
return ret;
mutex_init(&ctx->mixer_mutex);
- ctx->manager.type = EXYNOS_DISPLAY_TYPE_HDMI;
ctx->manager.ops = &mixer_manager_ops;
if (dev->of_node) {
platform_set_drvdata(pdev, ctx);
ret = exynos_drm_component_add(&pdev->dev, EXYNOS_DEVICE_TYPE_CRTC,
- ctx->manager.type);
+ EXYNOS_DISPLAY_TYPE_HDMI);
if (ret)
return ret;