Commit d081f566 authored by Inki Dae's avatar Inki Dae Committed by Dave Airlie

drm/exynos: added possible_clones setup function.

basically, all crtcs are possible to clone each other.
Signed-off-by: default avatarInki Dae <inki.dae@samsung.com>
Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 6f811502
...@@ -193,6 +193,9 @@ int exynos_drm_subdrv_register(struct exynos_drm_subdrv *subdrv) ...@@ -193,6 +193,9 @@ int exynos_drm_subdrv_register(struct exynos_drm_subdrv *subdrv)
return err; return err;
} }
/* setup possible_clones. */
exynos_drm_encoder_setup(drm_dev);
/* /*
* if any specific driver such as fimd or hdmi driver called * if any specific driver such as fimd or hdmi driver called
* exynos_drm_subdrv_register() later than drm_load(), * exynos_drm_subdrv_register() later than drm_load(),
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include "exynos_drm_drv.h" #include "exynos_drm_drv.h"
#include "exynos_drm_crtc.h" #include "exynos_drm_crtc.h"
#include "exynos_drm_encoder.h"
#include "exynos_drm_fbdev.h" #include "exynos_drm_fbdev.h"
#include "exynos_drm_fb.h" #include "exynos_drm_fb.h"
#include "exynos_drm_gem.h" #include "exynos_drm_gem.h"
...@@ -99,6 +100,9 @@ static int exynos_drm_load(struct drm_device *dev, unsigned long flags) ...@@ -99,6 +100,9 @@ static int exynos_drm_load(struct drm_device *dev, unsigned long flags)
if (ret) if (ret)
goto err_vblank; goto err_vblank;
/* setup possible_clones. */
exynos_drm_encoder_setup(dev);
/* /*
* create and configure fb helper and also exynos specific * create and configure fb helper and also exynos specific
* fbdev object. * fbdev object.
......
...@@ -195,6 +195,40 @@ static struct drm_encoder_funcs exynos_encoder_funcs = { ...@@ -195,6 +195,40 @@ static struct drm_encoder_funcs exynos_encoder_funcs = {
.destroy = exynos_drm_encoder_destroy, .destroy = exynos_drm_encoder_destroy,
}; };
static unsigned int exynos_drm_encoder_clones(struct drm_encoder *encoder)
{
struct drm_encoder *clone;
struct drm_device *dev = encoder->dev;
struct exynos_drm_encoder *exynos_encoder = to_exynos_encoder(encoder);
struct exynos_drm_display_ops *display_ops =
exynos_encoder->manager->display_ops;
unsigned int clone_mask = 0;
int cnt = 0;
list_for_each_entry(clone, &dev->mode_config.encoder_list, head) {
switch (display_ops->type) {
case EXYNOS_DISPLAY_TYPE_LCD:
case EXYNOS_DISPLAY_TYPE_HDMI:
clone_mask |= (1 << (cnt++));
break;
default:
continue;
}
}
return clone_mask;
}
void exynos_drm_encoder_setup(struct drm_device *dev)
{
struct drm_encoder *encoder;
DRM_DEBUG_KMS("%s\n", __FILE__);
list_for_each_entry(encoder, &dev->mode_config.encoder_list, head)
encoder->possible_clones = exynos_drm_encoder_clones(encoder);
}
struct drm_encoder * struct drm_encoder *
exynos_drm_encoder_create(struct drm_device *dev, exynos_drm_encoder_create(struct drm_device *dev,
struct exynos_drm_manager *manager, struct exynos_drm_manager *manager,
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
struct exynos_drm_manager; struct exynos_drm_manager;
void exynos_drm_encoder_setup(struct drm_device *dev);
struct drm_encoder *exynos_drm_encoder_create(struct drm_device *dev, struct drm_encoder *exynos_drm_encoder_create(struct drm_device *dev,
struct exynos_drm_manager *mgr, struct exynos_drm_manager *mgr,
unsigned int possible_crtcs); unsigned int possible_crtcs);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment