mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Helen Koike <helen.koike@collabora.com>
To: Tomasz Figa <tfiga@chromium.org>
Cc: ville.syrjala@linux.intel.com, "David Airlie" <airlied@linux.ie>,
	dnicoara@chromium.org, "Stéphane Marchesin" <marcheu@google.com>,
	"Sean Paul" <seanpaul@google.com>,
	"Alexandros Frantzis" <alexandros.frantzis@collabora.com>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	dri-devel <dri-devel@lists.freedesktop.org>,
	"Gustavo Padovan" <gustavo.padovan@collabora.com>,
	kernel@collabora.com
Subject: Re: [PATCH] drm: add capability DRM_CAP_ASYNC_UPDATE
Date: Thu, 13 Dec 2018 23:35:35 -0200	[thread overview]
Message-ID: <0a0a35bf-69e4-8dcd-46fc-7053081480d5@collabora.com> (raw)
In-Reply-To: <CAAFQd5BczTNdwUNcx42hC=OKkgZTV9JevHetYOjfDCnEz29LpA@mail.gmail.com>

Hi Tomasz,

On 12/13/18 2:02 AM, Tomasz Figa wrote:
> On Thu, Dec 6, 2018 at 1:12 AM Helen Koike <helen.koike@collabora.com> wrote:
>>
>> Hi Ville
>>
>> On 11/27/18 11:34 AM, Ville Syrjälä wrote:
>>> On Fri, Nov 23, 2018 at 07:53:26PM -0200, Helen Koike wrote:
>>>> Allow userspace to identify if the driver supports async update.
>>>
>>> And what exactly is an "async update"?
>>
>> I agree we are lacking docs on this, I'll send in the next version as
>> soon as we agree on a name (please see below).
>>
>> For reference:
>> https://lists.freedesktop.org/archives/dri-devel/2017-April/138586.html
>>
>>>
>>> I keep asking people to come up with the a better name for this, and to
>>> document what it actually means. Recently I've been think we should
>>> maybe just adopt the vulkan terminology (immediate/fifo/mailbox) to
>>> avoid introducing yet another set of names for the same thing. We'd
>>> still want to document things properly though.
>>
>> Another name it was suggested was "atomic amend", this feature basically
>> allows userspace to complement an update previously sent (i.e. its in
>> the queue and wasn't commited yet), it allows adding a plane update to
>> the next commit. So what do you think in renaming it to "atomic amend"?
> 
> Note that it doesn't seem to be what the code currently is doing. For
> example, for cursor updates, it doesn't seem to be working on the
> currently pending commit, but just directly issues an atomic async
> update call to the planes. The code actually seems to fall back to a
> normal sync commit, if there is an already pending commit touching the
> same plane or including a modeset.

It should fail as discussed at:
https://patchwork.freedesktop.org/patch/243088/

There was the following code inside the drm_atomic_helper_async_check()
in the previous patch which would fallback to a normal commit if there
isn't any pending commit to amend:

+	if (!old_plane_state->commit)
+		return -EINVAL;

In the v2 of the patch https://patchwork.freedesktop.org/patch/263712/
this got removed, but which means that async update will be enabled
anyway. So the following code is wrong:

-	if (state->legacy_cursor_update)
+	if (state->async_update || state->legacy_cursor_update)
 		state->async_update = !drm_atomic_helper_async_check(dev, state);

Does it make sense? If yes I'll fix this in the next version of the
Atomic IOCTL patch (and also those two patches should be in the same
series, I'll send them together next time).

Thanks for pointing this out.

Please let me know if you still don't agree on the name "atomic amend",
or if I am missing something.

Helen

> 
> Best regards,
> Tomasz
> 
>> Or do you suggest another name? I am not familiar with vulkan terminology.
>>
>>
>> Thanks
>> Helen
>>
>>>
>>>>
>>>> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
>>>> [prepared for upstream]
>>>> Signed-off-by: Helen Koike <helen.koike@collabora.com>
>>>>
>>>> ---
>>>> Hi,
>>>>
>>>> This patch introduces the ASYNC_UPDATE cap, which originated from the
>>>> discussion regarding DRM_MODE_ATOMIC_AMEND on [1], to allow user to
>>>> figure that async_update exists.
>>>>
>>>> This was tested using a small program that exercises the uAPI for easy
>>>> sanity testing. The program was created by Alexandros and modified by
>>>> Enric to test the capability flag [2].
>>>>
>>>> The test worked on a rockchip Ficus v1.1 board on top of mainline plus
>>>> the patch to update cursors asynchronously through atomic plus the patch
>>>> that introduces the ATOMIC_AMEND flag for the drm/rockchip driver.
>>>>
>>>> To test, just build the program and use the --atomic flag to use the cursor
>>>> plane with the ATOMIC_AMEND flag. E.g.
>>>>
>>>>   drm_cursor --atomic
>>>>
>>>> [1] https://patchwork.freedesktop.org/patch/243088/
>>>> [2] https://gitlab.collabora.com/eballetbo/drm-cursor/commits/async-capability
>>>>
>>>> Thanks
>>>> Helen
>>>>
>>>>
>>>>  drivers/gpu/drm/drm_ioctl.c | 11 +++++++++++
>>>>  include/uapi/drm/drm.h      |  1 +
>>>>  2 files changed, 12 insertions(+)
>>>>
>>>> diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c
>>>> index 94bd872d56c4..4a7e0f874171 100644
>>>> --- a/drivers/gpu/drm/drm_ioctl.c
>>>> +++ b/drivers/gpu/drm/drm_ioctl.c
>>>> @@ -31,6 +31,7 @@
>>>>  #include <drm/drm_ioctl.h>
>>>>  #include <drm/drmP.h>
>>>>  #include <drm/drm_auth.h>
>>>> +#include <drm/drm_modeset_helper_vtables.h>
>>>>  #include "drm_legacy.h"
>>>>  #include "drm_internal.h"
>>>>  #include "drm_crtc_internal.h"
>>>> @@ -229,6 +230,7 @@ static int drm_getcap(struct drm_device *dev, void *data, struct drm_file *file_
>>>>  {
>>>>      struct drm_get_cap *req = data;
>>>>      struct drm_crtc *crtc;
>>>> +    struct drm_plane *plane;
>>>>
>>>>      req->value = 0;
>>>>
>>>> @@ -292,6 +294,15 @@ static int drm_getcap(struct drm_device *dev, void *data, struct drm_file *file_
>>>>      case DRM_CAP_CRTC_IN_VBLANK_EVENT:
>>>>              req->value = 1;
>>>>              break;
>>>> +    case DRM_CAP_ASYNC_UPDATE:
>>>> +            req->value = 1;
>>>> +            list_for_each_entry(plane, &dev->mode_config.plane_list, head) {
>>>> +                    if (!plane->helper_private->atomic_async_update) {
>>>> +                            req->value = 0;
>>>> +                            break;
>>>> +                    }
>>>> +            }
>>>> +            break;
>>>>      default:
>>>>              return -EINVAL;
>>>>      }
>>>> diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h
>>>> index 300f336633f2..ff01540cbb1d 100644
>>>> --- a/include/uapi/drm/drm.h
>>>> +++ b/include/uapi/drm/drm.h
>>>> @@ -649,6 +649,7 @@ struct drm_gem_open {
>>>>  #define DRM_CAP_PAGE_FLIP_TARGET    0x11
>>>>  #define DRM_CAP_CRTC_IN_VBLANK_EVENT        0x12
>>>>  #define DRM_CAP_SYNCOBJ             0x13
>>>> +#define DRM_CAP_ASYNC_UPDATE                0x14
>>>>
>>>>  /** DRM_IOCTL_GET_CAP ioctl argument type */
>>>>  struct drm_get_cap {
>>>> --
>>>> 2.19.1
>>>>
>>>> _______________________________________________
>>>> dri-devel mailing list
>>>> dri-devel@lists.freedesktop.org
>>>> https://lists.freedesktop.org/mailman/listinfo/dri-devel
>>>

  reply	other threads:[~2018-12-14  1:35 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-23 21:53 Helen Koike
2018-11-27 13:34 ` Ville Syrjälä
2018-12-05 16:12   ` Helen Koike
2018-12-13  4:02     ` Tomasz Figa
2018-12-14  1:35       ` Helen Koike [this message]
2018-12-20  9:07         ` Tomasz Figa
2018-12-20 10:47           ` Daniel Vetter
2018-12-20 16:40             ` Alex Deucher
2018-12-20 16:54               ` Daniel Vetter
2018-12-20 17:03                 ` Alex Deucher
2018-12-20 17:09                   ` Daniel Vetter
2018-12-20 17:16                     ` Michel Dänzer
2018-12-20 17:24                       ` Daniel Vetter
2018-12-21  9:47                       ` Michel Dänzer
2018-12-21 13:26                         ` Daniel Vetter
2018-12-21 15:51                           ` Michel Dänzer
2018-12-20 17:38                     ` Kazlauskas, Nicholas
2018-12-20 18:34                       ` Daniel Vetter
2018-12-21  9:55                       ` Michel Dänzer
2018-12-21  3:51             ` Tomasz Figa
2018-12-21 13:42               ` Daniel Vetter

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=0a0a35bf-69e4-8dcd-46fc-7053081480d5@collabora.com \
    --to=helen.koike@collabora.com \
    --cc=airlied@linux.ie \
    --cc=alexandros.frantzis@collabora.com \
    --cc=dnicoara@chromium.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gustavo.padovan@collabora.com \
    --cc=kernel@collabora.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcheu@google.com \
    --cc=seanpaul@google.com \
    --cc=tfiga@chromium.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome