diff options
| author | Clarence Ip <cip@codeaurora.org> | 2016-09-09 10:47:17 -0400 |
|---|---|---|
| committer | Clarence Ip <cip@codeaurora.org> | 2016-10-12 16:57:53 -0400 |
| commit | 8d9449eeeeacb72a028220de267579e3dc30aed5 (patch) | |
| tree | 080a4659b73ffe2d4544b32433d060a39a234713 | |
| parent | c93322817cf2bc333076fffce96693c741ce1611 (diff) | |
drm/msm/sde: allow primary planes to be used with all crtcs
CRTC's are created for each display and require a dedicated primary
plane for non-atomic operation. Atomic callflows don't have this
requirement and allow for any plane to be used with any CRTC, as
long as the driver can support it.
This change optionally resets each plane's possible_crtcs bitmask to
allow it to be used by other CRTCs as well.
This allows the driver to work with both atomic and non-atomic
callflows as long as non-atomic clients respect each plane's
advertised primary/overlay type.
Change-Id: Ic613791322c2d9cd578c64db3d6e299451c385f3
Signed-off-by: Clarence Ip <cip@codeaurora.org>
| -rw-r--r-- | drivers/gpu/drm/msm/sde/sde_kms.c | 29 | ||||
| -rw-r--r-- | drivers/gpu/drm/msm/sde/sde_kms.h | 7 |
2 files changed, 35 insertions, 1 deletions
diff --git a/drivers/gpu/drm/msm/sde/sde_kms.c b/drivers/gpu/drm/msm/sde/sde_kms.c index 7cc371ec8114..2cc2647c7301 100644 --- a/drivers/gpu/drm/msm/sde/sde_kms.c +++ b/drivers/gpu/drm/msm/sde/sde_kms.c @@ -49,6 +49,26 @@ static const char * const iommu_ports[] = { #define SDE_DEBUGFS_DIR "msm_sde" #define SDE_DEBUGFS_HWMASKNAME "hw_log_mask" +/** + * sdecustom - enable certain driver customizations for sde clients + * Enabling this modifies the standard DRM behavior slightly and assumes + * that the clients have specific knowledge about the modifications that + * are involved, so don't enable this unless you know what you're doing. + * + * Parts of the driver that are affected by this setting may be located by + * searching for invocations of the 'sde_is_custom_client()' function. + * + * This is disabled by default. + */ +static bool sdecustom; +module_param(sdecustom, bool, 0400); +MODULE_PARM_DESC(sdecustom, "Enable customizations for sde clients"); + +bool sde_is_custom_client(void) +{ + return sdecustom; +} + static int sde_debugfs_show_regset32(struct seq_file *s, void *data) { struct sde_debugfs_regset32 *regset; @@ -312,7 +332,7 @@ static int modeset_init(struct sde_kms *sde_kms) int primary_planes_idx, i, ret; int max_crtc_count, max_plane_count; - if (!sde_kms || !sde_kms->dev) { + if (!sde_kms || !sde_kms->dev || !sde_kms->dev->dev) { SDE_ERROR("invalid sde_kms\n"); return -EINVAL; } @@ -361,6 +381,13 @@ static int modeset_init(struct sde_kms *sde_kms) priv->crtcs[priv->num_crtcs++] = crtc; } + if (sde_is_custom_client()) { + /* All CRTCs are compatible with all planes */ + for (i = 0; i < priv->num_planes; i++) + priv->planes[i]->possible_crtcs = + (1 << priv->num_crtcs) - 1; + } + /* All CRTCs are compatible with all encoders */ for (i = 0; i < priv->num_encoders; i++) priv->encoders[i]->possible_crtcs = (1 << priv->num_crtcs) - 1; diff --git a/drivers/gpu/drm/msm/sde/sde_kms.h b/drivers/gpu/drm/msm/sde/sde_kms.h index b2ea33be5c36..9c35060065db 100644 --- a/drivers/gpu/drm/msm/sde/sde_kms.h +++ b/drivers/gpu/drm/msm/sde/sde_kms.h @@ -198,6 +198,13 @@ struct sde_plane_state { ((S) && ((X) < PLANE_PROP_COUNT) ? ((S)->property_values[(X)]) : 0) /** + * sde_is_custom_client - whether or not to enable non-standard customizations + * + * Return: Whether or not the 'sdeclient' module parameter was set on boot up + */ +bool sde_is_custom_client(void); + +/** * Debugfs functions - extra helper functions for debugfs support * * Main debugfs documentation is located at, |
