Merge "disp: msm: sde: refactor use of master_plane_id"

This commit is contained in:
qctecmdr
2020-01-30 16:51:08 -08:00
committed by Gerrit - the friendly Code Review server

View File

@@ -3419,7 +3419,7 @@ bool sde_plane_is_cache_required(struct drm_plane *plane)
return false; return false;
} }
static void _sde_plane_install_non_master_properties(struct sde_plane *psde) static void _sde_plane_install_master_only_properties(struct sde_plane *psde)
{ {
char feature_name[256]; char feature_name[256];
@@ -3524,6 +3524,7 @@ static void _sde_plane_install_properties(struct drm_plane *plane,
const struct sde_format_extended *format_list; const struct sde_format_extended *format_list;
struct sde_kms_info *info; struct sde_kms_info *info;
struct sde_plane *psde = to_sde_plane(plane); struct sde_plane *psde = to_sde_plane(plane);
bool is_master;
int zpos_max = 255; int zpos_max = 255;
int zpos_def = 0; int zpos_def = 0;
char feature_name[256]; char feature_name[256];
@@ -3541,6 +3542,7 @@ static void _sde_plane_install_properties(struct drm_plane *plane,
} }
psde->catalog = catalog; psde->catalog = catalog;
is_master = !psde->is_virtual;
if (sde_is_custom_client()) { if (sde_is_custom_client()) {
if (catalog->mixer_count && if (catalog->mixer_count &&
@@ -3564,8 +3566,8 @@ static void _sde_plane_install_properties(struct drm_plane *plane,
msm_property_install_range(&psde->property_info, "input_fence", msm_property_install_range(&psde->property_info, "input_fence",
0x0, 0, INR_OPEN_MAX, 0, PLANE_PROP_INPUT_FENCE); 0x0, 0, INR_OPEN_MAX, 0, PLANE_PROP_INPUT_FENCE);
if (!master_plane_id) if (is_master)
_sde_plane_install_non_master_properties(psde); _sde_plane_install_master_only_properties(psde);
if (psde->features & BIT(SDE_SSPP_EXCL_RECT)) if (psde->features & BIT(SDE_SSPP_EXCL_RECT))
msm_property_install_volatile_range(&psde->property_info, msm_property_install_volatile_range(&psde->property_info,
@@ -3600,7 +3602,7 @@ static void _sde_plane_install_properties(struct drm_plane *plane,
DRM_MODE_PROP_IMMUTABLE, PLANE_PROP_INFO); DRM_MODE_PROP_IMMUTABLE, PLANE_PROP_INFO);
sde_kms_info_reset(info); sde_kms_info_reset(info);
if (!master_plane_id) { if (is_master) {
format_list = psde->pipe_sblk->format_list; format_list = psde->pipe_sblk->format_list;
} else { } else {
format_list = psde->pipe_sblk->virt_format_list; format_list = psde->pipe_sblk->virt_format_list;
@@ -3642,7 +3644,7 @@ static void _sde_plane_install_properties(struct drm_plane *plane,
sde_kms_info_add_keyint(info, "max_per_pipe_bw_high", sde_kms_info_add_keyint(info, "max_per_pipe_bw_high",
psde->pipe_sblk->max_per_pipe_bw_high * 1000LL); psde->pipe_sblk->max_per_pipe_bw_high * 1000LL);
if ((!master_plane_id && if ((is_master &&
(psde->features & BIT(SDE_SSPP_INVERSE_PMA))) || (psde->features & BIT(SDE_SSPP_INVERSE_PMA))) ||
(psde->features & BIT(SDE_SSPP_DGM_INVERSE_PMA))) { (psde->features & BIT(SDE_SSPP_DGM_INVERSE_PMA))) {
msm_property_install_range(&psde->property_info, msm_property_install_range(&psde->property_info,
@@ -4574,7 +4576,7 @@ struct drm_plane *sde_plane_init(struct drm_device *dev,
/* initialize underlying h/w driver */ /* initialize underlying h/w driver */
psde->pipe_hw = sde_hw_sspp_init(pipe, kms->mmio, kms->catalog, psde->pipe_hw = sde_hw_sspp_init(pipe, kms->mmio, kms->catalog,
master_plane_id != 0); psde->is_virtual);
if (IS_ERR(psde->pipe_hw)) { if (IS_ERR(psde->pipe_hw)) {
SDE_ERROR("[%u]SSPP init failed\n", pipe); SDE_ERROR("[%u]SSPP init failed\n", pipe);
ret = PTR_ERR(psde->pipe_hw); ret = PTR_ERR(psde->pipe_hw);
@@ -4593,10 +4595,10 @@ struct drm_plane *sde_plane_init(struct drm_device *dev,
goto clean_sspp; goto clean_sspp;
} }
if (!master_plane_id) if (psde->is_virtual)
format_list = psde->pipe_sblk->format_list;
else
format_list = psde->pipe_sblk->virt_format_list; format_list = psde->pipe_sblk->virt_format_list;
else
format_list = psde->pipe_sblk->format_list;
psde->nformats = sde_populate_formats(format_list, psde->nformats = sde_populate_formats(format_list,
psde->formats, psde->formats,
@@ -4638,7 +4640,7 @@ struct drm_plane *sde_plane_init(struct drm_device *dev,
mutex_init(&psde->lock); mutex_init(&psde->lock);
SDE_DEBUG("%s created for pipe:%u id:%u virtual:%u\n", psde->pipe_name, SDE_DEBUG("%s created for pipe:%u id:%u master:%u\n", psde->pipe_name,
pipe, plane->base.id, master_plane_id); pipe, plane->base.id, master_plane_id);
return plane; return plane;