All of lore.kernel.org
 help / color / mirror / Atom feed
From: Karthik B S <karthik.b.s@intel.com>
To: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
Cc: paulo.r.zanoni@intel.com, michel@daenzer.net,
	dri-devel@lists.freedesktop.org, nicholas.kazlauskas@amd.com,
	vandita.kulkarni@intel.com, uma.shankar@intel.com,
	daniel.vetter@intel.com, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v8 5/8] drm/i915: Add dedicated plane hook for async flip case
Date: Wed, 16 Sep 2020 18:30:27 +0530	[thread overview]
Message-ID: <9a647b20-c391-0997-4fe6-8579d4591aa9@intel.com> (raw)
In-Reply-To: <20200915144149.GN6112@intel.com>



On 9/15/2020 8:11 PM, Ville Syrjälä wrote:
> On Mon, Sep 14, 2020 at 11:26:30AM +0530, Karthik B S wrote:
>> This hook is added to avoid writing other plane registers in case of
>> async flips, so that we do not write the double buffered registers
>> during async surface address update.
>>
>> v7: -Plane ctl needs bits from skl_plane_ctl_crtc as well. (Ville)
>>      -Add a vfunc for skl_program_async_surface_address
>>       and call it from intel_update_plane. (Ville)
>>
>> v8: -Rebased.
>>
>> Signed-off-by: Karthik B S <karthik.b.s@intel.com>
>> Signed-off-by: Vandita Kulkarni <vandita.kulkarni@intel.com>
>> ---
>>   .../gpu/drm/i915/display/intel_atomic_plane.c |  7 ++++++
>>   .../drm/i915/display/intel_display_types.h    |  3 +++
>>   drivers/gpu/drm/i915/display/intel_sprite.c   | 24 +++++++++++++++++++
>>   3 files changed, 34 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.c b/drivers/gpu/drm/i915/display/intel_atomic_plane.c
>> index 79032701873a..fdc633020255 100644
>> --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.c
>> +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.c
>> @@ -408,6 +408,13 @@ void intel_update_plane(struct intel_plane *plane,
>>   	struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
>>   
>>   	trace_intel_update_plane(&plane->base, crtc);
>> +
>> +	if (crtc_state->uapi.async_flip) {
> 
> Hmm. Now I'm starting to wonder how this is actually going to interact
> with legacy cursor updates. The crtc_state we use there I think comes
> from the previous update and so will have this flag set it if was an
> async flip. Which means the cursor ioctl will oops.
> 
> We may want the igt to check this particular combination of ioctls
> actually.
> 

I tried this out locally by using the DRM_IOCTL_MODE_CURSOR ioctl after 
an async flip. And looks like its working fine. During the cursor commit 
it actually takes the 'else' path.

I'll send out the new version of the IGT shortly with this subtest 
added. Please let me know if I'm missing something there.

Thanks,
Karthik.B.S
>> +		plane->program_async_surface_address(plane,
>> +						     crtc_state, plane_state);
>> +		return;
>> +	}
>> +
>>   	plane->update_plane(plane, crtc_state, plane_state);
>>   }
>>   
>> diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h
>> index b2d0edacc58c..d2ae781e4d81 100644
>> --- a/drivers/gpu/drm/i915/display/intel_display_types.h
>> +++ b/drivers/gpu/drm/i915/display/intel_display_types.h
>> @@ -1190,6 +1190,9 @@ struct intel_plane {
>>   			   struct intel_plane_state *plane_state);
>>   	int (*min_cdclk)(const struct intel_crtc_state *crtc_state,
>>   			 const struct intel_plane_state *plane_state);
>> +	void (*program_async_surface_address)(struct intel_plane *plane,
>> +					      const struct intel_crtc_state *crtc_state,
>> +					      const struct intel_plane_state *plane_state);
>>   };
>>   
>>   struct intel_watermark_params {
>> diff --git a/drivers/gpu/drm/i915/display/intel_sprite.c b/drivers/gpu/drm/i915/display/intel_sprite.c
>> index f0c89418d2e1..69407dfcebf6 100644
>> --- a/drivers/gpu/drm/i915/display/intel_sprite.c
>> +++ b/drivers/gpu/drm/i915/display/intel_sprite.c
>> @@ -609,6 +609,29 @@ icl_program_input_csc(struct intel_plane *plane,
>>   			  PLANE_INPUT_CSC_POSTOFF(pipe, plane_id, 2), 0x0);
>>   }
>>   
>> +static void
>> +skl_program_async_surface_address(struct intel_plane *plane,
>> +				  const struct intel_crtc_state *crtc_state,
>> +				  const struct intel_plane_state *plane_state)
>> +{
>> +	struct drm_i915_private *dev_priv = to_i915(plane->base.dev);
>> +	unsigned long irqflags;
>> +	enum plane_id plane_id = plane->id;
>> +	enum pipe pipe = plane->pipe;
>> +	u32 surf_addr = plane_state->color_plane[0].offset;
>> +	u32 plane_ctl = plane_state->ctl;
>> +
>> +	plane_ctl |= skl_plane_ctl_crtc(crtc_state);
>> +
>> +	spin_lock_irqsave(&dev_priv->uncore.lock, irqflags);
>> +
>> +	intel_de_write_fw(dev_priv, PLANE_CTL(pipe, plane_id), plane_ctl);
>> +	intel_de_write_fw(dev_priv, PLANE_SURF(pipe, plane_id),
>> +			  intel_plane_ggtt_offset(plane_state) + surf_addr);
>> +
>> +	spin_unlock_irqrestore(&dev_priv->uncore.lock, irqflags);
>> +}
>> +
>>   static void
>>   skl_program_plane(struct intel_plane *plane,
>>   		  const struct intel_crtc_state *crtc_state,
>> @@ -3096,6 +3119,7 @@ skl_universal_plane_create(struct drm_i915_private *dev_priv,
>>   	plane->get_hw_state = skl_plane_get_hw_state;
>>   	plane->check_plane = skl_plane_check;
>>   	plane->min_cdclk = skl_plane_min_cdclk;
>> +	plane->program_async_surface_address = skl_program_async_surface_address;
>>   
>>   	if (INTEL_GEN(dev_priv) >= 11)
>>   		formats = icl_get_plane_formats(dev_priv, pipe,
>> -- 
>> 2.22.0
> 
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

WARNING: multiple messages have this Message-ID (diff)
From: Karthik B S <karthik.b.s@intel.com>
To: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
Cc: paulo.r.zanoni@intel.com, michel@daenzer.net,
	dri-devel@lists.freedesktop.org, nicholas.kazlauskas@amd.com,
	daniel.vetter@intel.com, harry.wentland@amd.com,
	intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH v8 5/8] drm/i915: Add dedicated plane hook for async flip case
Date: Wed, 16 Sep 2020 18:30:27 +0530	[thread overview]
Message-ID: <9a647b20-c391-0997-4fe6-8579d4591aa9@intel.com> (raw)
In-Reply-To: <20200915144149.GN6112@intel.com>



On 9/15/2020 8:11 PM, Ville Syrjälä wrote:
> On Mon, Sep 14, 2020 at 11:26:30AM +0530, Karthik B S wrote:
>> This hook is added to avoid writing other plane registers in case of
>> async flips, so that we do not write the double buffered registers
>> during async surface address update.
>>
>> v7: -Plane ctl needs bits from skl_plane_ctl_crtc as well. (Ville)
>>      -Add a vfunc for skl_program_async_surface_address
>>       and call it from intel_update_plane. (Ville)
>>
>> v8: -Rebased.
>>
>> Signed-off-by: Karthik B S <karthik.b.s@intel.com>
>> Signed-off-by: Vandita Kulkarni <vandita.kulkarni@intel.com>
>> ---
>>   .../gpu/drm/i915/display/intel_atomic_plane.c |  7 ++++++
>>   .../drm/i915/display/intel_display_types.h    |  3 +++
>>   drivers/gpu/drm/i915/display/intel_sprite.c   | 24 +++++++++++++++++++
>>   3 files changed, 34 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.c b/drivers/gpu/drm/i915/display/intel_atomic_plane.c
>> index 79032701873a..fdc633020255 100644
>> --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.c
>> +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.c
>> @@ -408,6 +408,13 @@ void intel_update_plane(struct intel_plane *plane,
>>   	struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
>>   
>>   	trace_intel_update_plane(&plane->base, crtc);
>> +
>> +	if (crtc_state->uapi.async_flip) {
> 
> Hmm. Now I'm starting to wonder how this is actually going to interact
> with legacy cursor updates. The crtc_state we use there I think comes
> from the previous update and so will have this flag set it if was an
> async flip. Which means the cursor ioctl will oops.
> 
> We may want the igt to check this particular combination of ioctls
> actually.
> 

I tried this out locally by using the DRM_IOCTL_MODE_CURSOR ioctl after 
an async flip. And looks like its working fine. During the cursor commit 
it actually takes the 'else' path.

I'll send out the new version of the IGT shortly with this subtest 
added. Please let me know if I'm missing something there.

Thanks,
Karthik.B.S
>> +		plane->program_async_surface_address(plane,
>> +						     crtc_state, plane_state);
>> +		return;
>> +	}
>> +
>>   	plane->update_plane(plane, crtc_state, plane_state);
>>   }
>>   
>> diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h
>> index b2d0edacc58c..d2ae781e4d81 100644
>> --- a/drivers/gpu/drm/i915/display/intel_display_types.h
>> +++ b/drivers/gpu/drm/i915/display/intel_display_types.h
>> @@ -1190,6 +1190,9 @@ struct intel_plane {
>>   			   struct intel_plane_state *plane_state);
>>   	int (*min_cdclk)(const struct intel_crtc_state *crtc_state,
>>   			 const struct intel_plane_state *plane_state);
>> +	void (*program_async_surface_address)(struct intel_plane *plane,
>> +					      const struct intel_crtc_state *crtc_state,
>> +					      const struct intel_plane_state *plane_state);
>>   };
>>   
>>   struct intel_watermark_params {
>> diff --git a/drivers/gpu/drm/i915/display/intel_sprite.c b/drivers/gpu/drm/i915/display/intel_sprite.c
>> index f0c89418d2e1..69407dfcebf6 100644
>> --- a/drivers/gpu/drm/i915/display/intel_sprite.c
>> +++ b/drivers/gpu/drm/i915/display/intel_sprite.c
>> @@ -609,6 +609,29 @@ icl_program_input_csc(struct intel_plane *plane,
>>   			  PLANE_INPUT_CSC_POSTOFF(pipe, plane_id, 2), 0x0);
>>   }
>>   
>> +static void
>> +skl_program_async_surface_address(struct intel_plane *plane,
>> +				  const struct intel_crtc_state *crtc_state,
>> +				  const struct intel_plane_state *plane_state)
>> +{
>> +	struct drm_i915_private *dev_priv = to_i915(plane->base.dev);
>> +	unsigned long irqflags;
>> +	enum plane_id plane_id = plane->id;
>> +	enum pipe pipe = plane->pipe;
>> +	u32 surf_addr = plane_state->color_plane[0].offset;
>> +	u32 plane_ctl = plane_state->ctl;
>> +
>> +	plane_ctl |= skl_plane_ctl_crtc(crtc_state);
>> +
>> +	spin_lock_irqsave(&dev_priv->uncore.lock, irqflags);
>> +
>> +	intel_de_write_fw(dev_priv, PLANE_CTL(pipe, plane_id), plane_ctl);
>> +	intel_de_write_fw(dev_priv, PLANE_SURF(pipe, plane_id),
>> +			  intel_plane_ggtt_offset(plane_state) + surf_addr);
>> +
>> +	spin_unlock_irqrestore(&dev_priv->uncore.lock, irqflags);
>> +}
>> +
>>   static void
>>   skl_program_plane(struct intel_plane *plane,
>>   		  const struct intel_crtc_state *crtc_state,
>> @@ -3096,6 +3119,7 @@ skl_universal_plane_create(struct drm_i915_private *dev_priv,
>>   	plane->get_hw_state = skl_plane_get_hw_state;
>>   	plane->check_plane = skl_plane_check;
>>   	plane->min_cdclk = skl_plane_min_cdclk;
>> +	plane->program_async_surface_address = skl_program_async_surface_address;
>>   
>>   	if (INTEL_GEN(dev_priv) >= 11)
>>   		formats = icl_get_plane_formats(dev_priv, pipe,
>> -- 
>> 2.22.0
> 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2020-09-16 13:00 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-14  5:56 [PATCH v8 0/8] Asynchronous flip implementation for i915 Karthik B S
2020-09-14  5:56 ` [Intel-gfx] " Karthik B S
2020-09-14  5:56 ` [PATCH v8 1/8] drm/i915: Add enable/disable flip done and flip done handler Karthik B S
2020-09-14  5:56   ` [Intel-gfx] " Karthik B S
2020-09-15 13:47   ` Ville Syrjälä
2020-09-15 13:47     ` [Intel-gfx] " Ville Syrjälä
2020-09-16 12:36     ` Karthik B S
2020-09-16 12:36       ` [Intel-gfx] " Karthik B S
2020-09-14  5:56 ` [PATCH v8 2/8] drm/i915: Add support for async flips in I915 Karthik B S
2020-09-14  5:56   ` [Intel-gfx] " Karthik B S
2020-09-15 13:48   ` Ville Syrjälä
2020-09-15 13:48     ` [Intel-gfx] " Ville Syrjälä
2020-09-16 12:38     ` Karthik B S
2020-09-16 12:38       ` [Intel-gfx] " Karthik B S
2020-09-14  5:56 ` [PATCH v8 3/8] drm/i915: Add checks specific to async flips Karthik B S
2020-09-14  5:56   ` [Intel-gfx] " Karthik B S
2020-09-15 14:03   ` Ville Syrjälä
2020-09-15 14:03     ` [Intel-gfx] " Ville Syrjälä
2020-09-16 12:44     ` Karthik B S
2020-09-16 12:44       ` [Intel-gfx] " Karthik B S
2020-09-14  5:56 ` [PATCH v8 4/8] drm/i915: Do not call drm_crtc_arm_vblank_event in " Karthik B S
2020-09-14  5:56   ` [Intel-gfx] " Karthik B S
2020-09-15 14:07   ` Ville Syrjälä
2020-09-15 14:07     ` [Intel-gfx] " Ville Syrjälä
2020-09-16 12:46     ` Karthik B S
2020-09-16 12:46       ` [Intel-gfx] " Karthik B S
2020-09-14  5:56 ` [PATCH v8 5/8] drm/i915: Add dedicated plane hook for async flip case Karthik B S
2020-09-14  5:56   ` [Intel-gfx] " Karthik B S
2020-09-15 14:10   ` Ville Syrjälä
2020-09-15 14:10     ` [Intel-gfx] " Ville Syrjälä
2020-09-16 12:48     ` Karthik B S
2020-09-16 12:48       ` [Intel-gfx] " Karthik B S
2020-09-15 14:41   ` Ville Syrjälä
2020-09-15 14:41     ` [Intel-gfx] " Ville Syrjälä
2020-09-16 13:00     ` Karthik B S [this message]
2020-09-16 13:00       ` Karthik B S
2020-09-16 15:52       ` Karthik B S
2020-09-16 15:52         ` [Intel-gfx] " Karthik B S
2020-09-14  5:56 ` [PATCH v8 6/8] drm/i915: WA for platforms with double buffered adress update enable bit Karthik B S
2020-09-14  5:56   ` [Intel-gfx] " Karthik B S
2020-09-15 14:19   ` Ville Syrjälä
2020-09-15 14:19     ` [Intel-gfx] " Ville Syrjälä
2020-09-16 12:54     ` Karthik B S
2020-09-16 12:54       ` [Intel-gfx] " Karthik B S
2020-09-14  5:56 ` [PATCH v8 7/8] Documentation/gpu: Add asynchronous flip documentation for i915 Karthik B S
2020-09-14  5:56   ` [Intel-gfx] " Karthik B S
2020-09-14  5:56 ` [PATCH v8 8/8] drm/i915: Enable async flips in i915 Karthik B S
2020-09-14  5:56   ` [Intel-gfx] " Karthik B S
2020-09-14 11:22 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for Asynchronous flip implementation for i915 (rev8) Patchwork
2020-09-14 11:23 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2020-09-14 11:45 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2020-09-14 13:12 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9a647b20-c391-0997-4fe6-8579d4591aa9@intel.com \
    --to=karthik.b.s@intel.com \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=michel@daenzer.net \
    --cc=nicholas.kazlauskas@amd.com \
    --cc=paulo.r.zanoni@intel.com \
    --cc=uma.shankar@intel.com \
    --cc=vandita.kulkarni@intel.com \
    --cc=ville.syrjala@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.