linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] drm/vc4: Return -EBUSY if there's already a pending flip event.
@ 2016-05-03 17:48 robert.foss
  2016-05-03 19:22 ` Eric Anholt
  0 siblings, 1 reply; 5+ messages in thread
From: robert.foss @ 2016-05-03 17:48 UTC (permalink / raw)
  To: daniel.vetter, airlied, eric, aniel.vetter, fengguang.wu,
	maarten.lankhorst, julia.lawall, alexander.deucher, daniels,
	derekf, varadgautam
  Cc: dri-devel, linux-kernel, Robert Foss

From: Robert Foss <robert.foss@collabora.com>

As per the documentation in drm_crtc.h, atomic_commit should return
-EBUSY if an asycnhronous update is requested and there is an earlier
update pending.

Note: docs cited here are drm_crtc.h, and the whole quote is:

    *  - -EBUSY, if an asynchronous updated is requested and there is
    *    an earlier updated pending. Drivers are allowed to support a queue
    *    of outstanding updates, but currently no driver supports that.
    *    Note that drivers must wait for preceding updates to complete if a
    *    synchronous update is requested, they are not allowed to fail the
    *    commit in that case.

Signed-off-by: Robert Foss <robert.foss@collabora.com>
---

Changes since v1:
- Corrected and simplified patch to piggyback on a previously existing check.

 drivers/gpu/drm/vc4/vc4_kms.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/vc4/vc4_kms.c b/drivers/gpu/drm/vc4/vc4_kms.c
index 4718ae5..7c7188d 100644
--- a/drivers/gpu/drm/vc4/vc4_kms.c
+++ b/drivers/gpu/drm/vc4/vc4_kms.c
@@ -117,10 +117,18 @@ static int vc4_atomic_commit(struct drm_device *dev,
 		return -ENOMEM;
 
 	/* Make sure that any outstanding modesets have finished. */
-	ret = down_interruptible(&vc4->async_modeset);
-	if (ret) {
-		kfree(c);
-		return ret;
+	if (async) {
+		ret = down_trylock(&vc4->async_modeset);
+		if (ret) {
+			kfree(c);
+			return -EBUSY;
+		}
+	} else {
+		ret = down_interruptible(&vc4->async_modeset);
+		if (ret) {
+			kfree(c);
+			return ret;
+		}
 	}
 
 	ret = drm_atomic_helper_prepare_planes(dev, state);
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] drm/vc4: Return -EBUSY if there's already a pending flip event.
  2016-05-03 17:48 [PATCH v2] drm/vc4: Return -EBUSY if there's already a pending flip event robert.foss
@ 2016-05-03 19:22 ` Eric Anholt
  2016-05-10 15:35   ` Robert Foss
  0 siblings, 1 reply; 5+ messages in thread
From: Eric Anholt @ 2016-05-03 19:22 UTC (permalink / raw)
  To: robert.foss, daniel.vetter, airlied, aniel.vetter, fengguang.wu,
	maarten.lankhorst, julia.lawall, alexander.deucher, daniels,
	derekf, varadgautam
  Cc: dri-devel, linux-kernel, Robert Foss

[-- Attachment #1: Type: text/plain, Size: 888 bytes --]

robert.foss@collabora.com writes:

> From: Robert Foss <robert.foss@collabora.com>
>
> As per the documentation in drm_crtc.h, atomic_commit should return
> -EBUSY if an asycnhronous update is requested and there is an earlier
> update pending.
>
> Note: docs cited here are drm_crtc.h, and the whole quote is:
>
>     *  - -EBUSY, if an asynchronous updated is requested and there is
>     *    an earlier updated pending. Drivers are allowed to support a queue
>     *    of outstanding updates, but currently no driver supports that.
>     *    Note that drivers must wait for preceding updates to complete if a
>     *    synchronous update is requested, they are not allowed to fail the
>     *    commit in that case.
>
> Signed-off-by: Robert Foss <robert.foss@collabora.com>

This looks good to me.  Let's give it a few days on the list for any
other KMS folks to catch anything.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] drm/vc4: Return -EBUSY if there's already a pending flip event.
  2016-05-03 19:22 ` Eric Anholt
@ 2016-05-10 15:35   ` Robert Foss
  2016-05-10 17:06     ` Eric Anholt
  0 siblings, 1 reply; 5+ messages in thread
From: Robert Foss @ 2016-05-10 15:35 UTC (permalink / raw)
  To: Eric Anholt, daniel.vetter, airlied, aniel.vetter, fengguang.wu,
	maarten.lankhorst, julia.lawall, alexander.deucher, daniels,
	derekf, varadgautam
  Cc: dri-devel, linux-kernel



On 2016-05-03 03:22 PM, Eric Anholt wrote:
> robert.foss@collabora.com writes:
>
>> From: Robert Foss <robert.foss@collabora.com>
>>
>> As per the documentation in drm_crtc.h, atomic_commit should return
>> -EBUSY if an asycnhronous update is requested and there is an earlier
>> update pending.
>>
>> Note: docs cited here are drm_crtc.h, and the whole quote is:
>>
>>      *  - -EBUSY, if an asynchronous updated is requested and there is
>>      *    an earlier updated pending. Drivers are allowed to support a queue
>>      *    of outstanding updates, but currently no driver supports that.
>>      *    Note that drivers must wait for preceding updates to complete if a
>>      *    synchronous update is requested, they are not allowed to fail the
>>      *    commit in that case.
>>
>> Signed-off-by: Robert Foss <robert.foss@collabora.com>
>
> This looks good to me.  Let's give it a few days on the list for any
> other KMS folks to catch anything.
>

I haven't seen any further feedback regarding this patch.
Does anyone have objections to it being merged?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] drm/vc4: Return -EBUSY if there's already a pending flip event.
  2016-05-10 15:35   ` Robert Foss
@ 2016-05-10 17:06     ` Eric Anholt
  2016-05-10 17:19       ` Robert Foss
  0 siblings, 1 reply; 5+ messages in thread
From: Eric Anholt @ 2016-05-10 17:06 UTC (permalink / raw)
  To: Robert Foss, daniel.vetter, airlied, aniel.vetter, fengguang.wu,
	maarten.lankhorst, julia.lawall, alexander.deucher, daniels,
	derekf, varadgautam
  Cc: dri-devel, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1201 bytes --]

Robert Foss <robert.foss@collabora.com> writes:

> On 2016-05-03 03:22 PM, Eric Anholt wrote:
>> robert.foss@collabora.com writes:
>>
>>> From: Robert Foss <robert.foss@collabora.com>
>>>
>>> As per the documentation in drm_crtc.h, atomic_commit should return
>>> -EBUSY if an asycnhronous update is requested and there is an earlier
>>> update pending.
>>>
>>> Note: docs cited here are drm_crtc.h, and the whole quote is:
>>>
>>>      *  - -EBUSY, if an asynchronous updated is requested and there is
>>>      *    an earlier updated pending. Drivers are allowed to support a queue
>>>      *    of outstanding updates, but currently no driver supports that.
>>>      *    Note that drivers must wait for preceding updates to complete if a
>>>      *    synchronous update is requested, they are not allowed to fail the
>>>      *    commit in that case.
>>>
>>> Signed-off-by: Robert Foss <robert.foss@collabora.com>
>>
>> This looks good to me.  Let's give it a few days on the list for any
>> other KMS folks to catch anything.
>>
>
> I haven't seen any further feedback regarding this patch.
> Does anyone have objections to it being merged?

I merged it to drm-vc4-next last night, actually :)

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] drm/vc4: Return -EBUSY if there's already a pending flip event.
  2016-05-10 17:06     ` Eric Anholt
@ 2016-05-10 17:19       ` Robert Foss
  0 siblings, 0 replies; 5+ messages in thread
From: Robert Foss @ 2016-05-10 17:19 UTC (permalink / raw)
  To: Eric Anholt, daniel.vetter, airlied, aniel.vetter, fengguang.wu,
	maarten.lankhorst, julia.lawall, alexander.deucher, daniels,
	derekf, varadgautam
  Cc: dri-devel, linux-kernel

Thanks Eric!

On 2016-05-10 01:06 PM, Eric Anholt wrote:
> Robert Foss <robert.foss@collabora.com> writes:
>
>> On 2016-05-03 03:22 PM, Eric Anholt wrote:
>>> robert.foss@collabora.com writes:
>>>
>>>> From: Robert Foss <robert.foss@collabora.com>
>>>>
>>>> As per the documentation in drm_crtc.h, atomic_commit should return
>>>> -EBUSY if an asycnhronous update is requested and there is an earlier
>>>> update pending.
>>>>
>>>> Note: docs cited here are drm_crtc.h, and the whole quote is:
>>>>
>>>>       *  - -EBUSY, if an asynchronous updated is requested and there is
>>>>       *    an earlier updated pending. Drivers are allowed to support a queue
>>>>       *    of outstanding updates, but currently no driver supports that.
>>>>       *    Note that drivers must wait for preceding updates to complete if a
>>>>       *    synchronous update is requested, they are not allowed to fail the
>>>>       *    commit in that case.
>>>>
>>>> Signed-off-by: Robert Foss <robert.foss@collabora.com>
>>>
>>> This looks good to me.  Let's give it a few days on the list for any
>>> other KMS folks to catch anything.
>>>
>>
>> I haven't seen any further feedback regarding this patch.
>> Does anyone have objections to it being merged?
>
> I merged it to drm-vc4-next last night, actually :)
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-05-10 17:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-03 17:48 [PATCH v2] drm/vc4: Return -EBUSY if there's already a pending flip event robert.foss
2016-05-03 19:22 ` Eric Anholt
2016-05-10 15:35   ` Robert Foss
2016-05-10 17:06     ` Eric Anholt
2016-05-10 17:19       ` Robert Foss

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).