Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e4a5dda3 authored by Dhaval Patel's avatar Dhaval Patel Committed by Narendra Muppalla
Browse files

drm/msm: add capability property for crtc



Add capability property for crtc to update
all system wide capabilities like hardware rev,
ubwc support, source split, qseed rev support, etc.

Change-Id: Iecc6f4ec7376f7f5de884042aa7a3b0a5387d6d6
Signed-off-by: default avatarDhaval Patel <pdhaval@codeaurora.org>
parent 1964fb9e
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -103,6 +103,8 @@ enum msm_mdp_plane_property {
};

enum msm_mdp_crtc_property {
	CRTC_PROP_INFO,

	/* # of blob properties */
	CRTC_PROP_BLOBCOUNT,

+34 −4
Original line number Diff line number Diff line
@@ -56,6 +56,9 @@ static void sde_crtc_destroy(struct drm_crtc *crtc)
	if (!crtc)
		return;

	if (sde_crtc->blob_info)
		drm_property_unreference_blob(sde_crtc->blob_info);

	msm_property_destroy(&sde_crtc->property_info);
	sde_cp_crtc_destroy_properties(crtc);
	debugfs_remove_recursive(sde_crtc->debugfs_root);
@@ -935,21 +938,29 @@ void sde_crtc_cancel_pending_flip(struct drm_crtc *crtc, struct drm_file *file)
 * sde_crtc_install_properties - install all drm properties for crtc
 * @crtc: Pointer to drm crtc structure
 */
static void sde_crtc_install_properties(struct drm_crtc *crtc)
static void sde_crtc_install_properties(struct drm_crtc *crtc,
				struct sde_mdss_cfg *catalog)
{
	struct sde_crtc *sde_crtc;
	struct drm_device *dev;
	struct sde_kms_info *info;

	SDE_DEBUG("\n");

	if (!crtc) {
		SDE_ERROR("invalid crtc\n");
	if (!crtc || !catalog) {
		SDE_ERROR("invalid crtc or catalog\n");
		return;
	}

	sde_crtc = to_sde_crtc(crtc);
	dev = crtc->dev;

	info = kzalloc(sizeof(struct sde_kms_info), GFP_KERNEL);
	if (!info) {
		SDE_ERROR("failed to allocate info memory\n");
		return;
	}

	/* range properties */
	msm_property_install_range(&sde_crtc->property_info,
		"input_fence_timeout", 0x0, 0, SDE_CRTC_MAX_INPUT_FENCE_TIMEOUT,
@@ -961,6 +972,25 @@ static void sde_crtc_install_properties(struct drm_crtc *crtc)
	msm_property_install_range(&sde_crtc->property_info,
			"output_fence_offset", 0x0, 0, 1, 0,
			CRTC_PROP_OUTPUT_FENCE_OFFSET);

	msm_property_install_blob(&sde_crtc->property_info, "capabilities",
		DRM_MODE_PROP_IMMUTABLE, CRTC_PROP_INFO);
	sde_kms_info_reset(info);

	sde_kms_info_add_keyint(info, "hw_version", catalog->hwversion);
	sde_kms_info_add_keyint(info, "max_linewidth",
			catalog->max_mixer_width);
	sde_kms_info_add_keyint(info, "max_blendstages",
			catalog->max_mixer_blendstages);
	if (catalog->qseed_type == SDE_SSPP_SCALER_QSEED2)
		sde_kms_info_add_keystr(info, "qseed_type", "qseed2");
	if (catalog->qseed_type == SDE_SSPP_SCALER_QSEED3)
		sde_kms_info_add_keystr(info, "qseed_type", "qseed3");
	sde_kms_info_add_keyint(info, "has_src_split", catalog->has_src_split);
	msm_property_set_blob(&sde_crtc->property_info, &sde_crtc->blob_info,
			info->data, info->len, CRTC_PROP_INFO);

	kfree(info);
}

/**
@@ -1201,7 +1231,7 @@ struct drm_crtc *sde_crtc_init(struct drm_device *dev, struct drm_plane *plane)
			CRTC_PROP_COUNT, CRTC_PROP_BLOBCOUNT,
			sizeof(struct sde_crtc_state));

	sde_crtc_install_properties(crtc);
	sde_crtc_install_properties(crtc, kms->catalog);
	sde_cp_crtc_init(crtc);

	SDE_DEBUG("%s: successfully initialized crtc\n", sde_crtc->name);
+1 −0
Original line number Diff line number Diff line
@@ -72,6 +72,7 @@ struct sde_crtc {

	struct msm_property_info property_info;
	struct msm_property_data property_data[CRTC_PROP_COUNT];
	struct drm_property_blob *blob_info;

	/* output fence support */
	struct sde_fence output_fence;
+1 −2
Original line number Diff line number Diff line
@@ -687,8 +687,7 @@ struct msm_kms *sde_kms_init(struct drm_device *dev)
	 * max crtc width is equal to the max mixer width * 2 and max height is
	 * is 4K
	 */
	dev->mode_config.max_width =
			sde_kms->catalog->mixer[0].sblk->maxwidth * 2;
	dev->mode_config.max_width = sde_kms->catalog->max_mixer_width * 2;
	dev->mode_config.max_height = 4096;

	/*