Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1393682 > unrolled thread

[PATCH v2] drm/vc4: Return -EBUSY if there's already a pending flip event.

Started byrobert.foss@collabora.com
First post2016-05-03 19:50 +0200
Last post2016-05-10 19:20 +0200
Articles 5 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH v2] drm/vc4: Return -EBUSY if there's already a pending flip event. robert.foss@collabora.com - 2016-05-03 19:50 +0200
    Re: [PATCH v2] drm/vc4: Return -EBUSY if there's already a pending flip event. Eric Anholt <eric@anholt.net> - 2016-05-03 21:30 +0200
      Re: [PATCH v2] drm/vc4: Return -EBUSY if there's already a pending  flip event. Robert Foss <robert.foss@collabora.com> - 2016-05-10 17:40 +0200
        Re: [PATCH v2] drm/vc4: Return -EBUSY if there's already a pending flip event. Eric Anholt <eric@anholt.net> - 2016-05-10 19:10 +0200
          Re: [PATCH v2] drm/vc4: Return -EBUSY if there's already a pending  flip event. Robert Foss <robert.foss@collabora.com> - 2016-05-10 19:20 +0200

#1393682 — [PATCH v2] drm/vc4: Return -EBUSY if there's already a pending flip event.

Fromrobert.foss@collabora.com
Date2016-05-03 19:50 +0200
Subject[PATCH v2] drm/vc4: Return -EBUSY if there's already a pending flip event.
Message-ID<ruMCn-3Wx-21@gated-at.bofh.it>
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

[toc] | [next] | [standalone]


#1393757

FromEric Anholt <eric@anholt.net>
Date2016-05-03 21:30 +0200
Message-ID<ruOb7-5Gk-7@gated-at.bofh.it>
In reply to#1393682

[Multipart message — attachments visible in raw view] — view raw

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.

[toc] | [prev] | [next] | [standalone]


#1398250 — Re: [PATCH v2] drm/vc4: Return -EBUSY if there's already a pending flip event.

FromRobert Foss <robert.foss@collabora.com>
Date2016-05-10 17:40 +0200
SubjectRe: [PATCH v2] drm/vc4: Return -EBUSY if there's already a pending flip event.
Message-ID<rxhVo-59L-15@gated-at.bofh.it>
In reply to#1393757

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?

[toc] | [prev] | [next] | [standalone]


#1398329

FromEric Anholt <eric@anholt.net>
Date2016-05-10 19:10 +0200
Message-ID<rxjku-6P9-9@gated-at.bofh.it>
In reply to#1398250

[Multipart message — attachments visible in raw view] — view raw

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 :)

[toc] | [prev] | [next] | [standalone]


#1398334 — Re: [PATCH v2] drm/vc4: Return -EBUSY if there's already a pending flip event.

FromRobert Foss <robert.foss@collabora.com>
Date2016-05-10 19:20 +0200
SubjectRe: [PATCH v2] drm/vc4: Return -EBUSY if there's already a pending flip event.
Message-ID<rxjua-6Xg-3@gated-at.bofh.it>
In reply to#1398329
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 :)
>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web