mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-26 19:30:53 +07:00
drm/exynos: added possible_clones setup function.
basically, all crtcs are possible to clone each other. Signed-off-by: Inki Dae <inki.dae@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
This commit is contained in:
parent
a04afc1db9
commit
63fb8989e2
@ -193,6 +193,9 @@ int exynos_drm_subdrv_register(struct exynos_drm_subdrv *subdrv)
|
||||
return err;
|
||||
}
|
||||
|
||||
/* setup possible_clones. */
|
||||
exynos_drm_encoder_setup(drm_dev);
|
||||
|
||||
/*
|
||||
* if any specific driver such as fimd or hdmi driver called
|
||||
* exynos_drm_subdrv_register() later than drm_load(),
|
||||
|
@ -33,6 +33,7 @@
|
||||
|
||||
#include "exynos_drm_drv.h"
|
||||
#include "exynos_drm_crtc.h"
|
||||
#include "exynos_drm_encoder.h"
|
||||
#include "exynos_drm_fbdev.h"
|
||||
#include "exynos_drm_fb.h"
|
||||
#include "exynos_drm_gem.h"
|
||||
@ -99,6 +100,9 @@ static int exynos_drm_load(struct drm_device *dev, unsigned long flags)
|
||||
if (ret)
|
||||
goto err_vblank;
|
||||
|
||||
/* setup possible_clones. */
|
||||
exynos_drm_encoder_setup(dev);
|
||||
|
||||
/*
|
||||
* create and configure fb helper and also exynos specific
|
||||
* fbdev object.
|
||||
|
@ -195,6 +195,40 @@ static struct drm_encoder_funcs exynos_encoder_funcs = {
|
||||
.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 *
|
||||
exynos_drm_encoder_create(struct drm_device *dev,
|
||||
struct exynos_drm_manager *manager,
|
||||
|
@ -30,6 +30,7 @@
|
||||
|
||||
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 exynos_drm_manager *mgr,
|
||||
unsigned int possible_crtcs);
|
||||
|
Loading…
Reference in New Issue
Block a user