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

Commit ac933647 authored by Lloyd Atkinson's avatar Lloyd Atkinson Committed by Narendra Muppalla
Browse files

drm/msm/sde: move sde_crtc away from legacy drm vblank apis



Fix up the SDE CRTC to use the DRM framework's updated vblank
related APIs that do not require sub-driver CRTCs to track their
own DRM CRTC IDs.

Change-Id: Idaa208e6c895850e89a8f8189f9169bd1ca67da8
Signed-off-by: default avatarLloyd Atkinson <latkinso@codeaurora.org>
parent 8772e20b
Loading
Loading
Loading
Loading
+3 −11
Original line number Diff line number Diff line
@@ -339,8 +339,7 @@ static void complete_flip(struct drm_crtc *crtc, struct drm_file *file)
			sde_crtc->event = NULL;
			SDE_DEBUG("%s: send event: %pK\n",
						sde_crtc->name, event);
			drm_send_vblank_event(dev, sde_crtc->drm_crtc_id,
					event);
			drm_crtc_send_vblank_event(crtc, event);
		}
	}
	spin_unlock_irqrestore(&dev->event_lock, flags);
@@ -349,11 +348,8 @@ static void complete_flip(struct drm_crtc *crtc, struct drm_file *file)
static void sde_crtc_vblank_cb(void *data)
{
	struct drm_crtc *crtc = (struct drm_crtc *)data;
	struct sde_crtc *sde_crtc = to_sde_crtc(crtc);
	struct sde_kms *sde_kms = get_kms(crtc);
	struct drm_device *dev = sde_kms->dev;

	drm_handle_vblank(dev, sde_crtc->drm_crtc_id);
	drm_crtc_handle_vblank(crtc);
	DBG_IRQ("");
	MSM_EVT(crtc->dev, crtc->base.id, 0);
}
@@ -1182,9 +1178,7 @@ static void _sde_crtc_init_debugfs(struct sde_crtc *sde_crtc,
}

/* initialize crtc */
struct drm_crtc *sde_crtc_init(struct drm_device *dev,
		struct drm_plane *plane,
		int drm_crtc_id)
struct drm_crtc *sde_crtc_init(struct drm_device *dev, struct drm_plane *plane)
{
	struct drm_crtc *crtc = NULL;
	struct sde_crtc *sde_crtc = NULL;
@@ -1201,8 +1195,6 @@ struct drm_crtc *sde_crtc_init(struct drm_device *dev,
	crtc = &sde_crtc->base;
	crtc->dev = dev;

	sde_crtc->drm_crtc_id = drm_crtc_id;

	drm_crtc_init_with_planes(dev, crtc, plane, NULL, &sde_crtc_funcs);

	drm_crtc_helper_add(crtc, &sde_crtc_helper_funcs);
+0 −5
Original line number Diff line number Diff line
@@ -46,9 +46,6 @@ struct sde_crtc_mixer {
 * struct sde_crtc - virtualized CRTC data structure
 * @base          : Base drm crtc structure
 * @name          : ASCII description of this crtc
 * @drm_crtc_id   : Id for reporting vblank. Id is relative init order into
 *                  mode_config.crtc_list and used by user space to identify
 *                  specific crtc in apis such as drm_wait_vblank
 * @num_ctls      : Number of ctl paths in use
 * @num_mixers    : Number of mixers in use
 * @mixer         : List of active mixers
@@ -68,8 +65,6 @@ struct sde_crtc {
	struct drm_crtc base;
	char name[SDE_CRTC_NAME_SIZE];

	int drm_crtc_id;

	/* HW Resources reserved for the crtc */
	u32 num_ctls;
	u32 num_mixers;
+1 −1
Original line number Diff line number Diff line
@@ -373,7 +373,7 @@ static int modeset_init(struct sde_kms *sde_kms)

	/* Create one CRTC per encoder */
	for (i = 0; i < max_crtc_count; i++) {
		crtc = sde_crtc_init(dev, primary_planes[i], i);
		crtc = sde_crtc_init(dev, primary_planes[i]);
		if (IS_ERR(crtc)) {
			ret = PTR_ERR(crtc);
			goto fail;
+1 −4
Original line number Diff line number Diff line
@@ -432,12 +432,9 @@ void sde_crtc_prepare_fence(struct drm_crtc *crtc);
 * sde_crtc_init - create a new crtc object
 * @dev: sde device
 * @plane: base plane
 * @vblank_id: Id for reporting vblank. Id in range from 0..dev->num_crtcs.
 * @Return: new crtc object or error
 */
struct drm_crtc *sde_crtc_init(struct drm_device *dev,
		struct drm_plane *plane,
		int vblank_id);
struct drm_crtc *sde_crtc_init(struct drm_device *dev, struct drm_plane *plane);

/**
 * sde_crtc_complete_commit - callback signalling completion of current commit