All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Yacoub <markyacoub@chromium.org>
To: "Michel Dänzer" <michel@daenzer.net>
Cc: Maling list - DRI developers <dri-devel@lists.freedesktop.org>,
	Sean Paul <seanpaul@chromium.org>,
	 abhinavk@codeaurora.org, Rob Clark <robdclark@chromium.org>,
	airlied@linux.ie,  Mark Yacoub <markyacoub@google.com>
Subject: Re: [PATCH v2] drm: Copy drm_wait_vblank to user before returning
Date: Fri, 13 Aug 2021 11:48:42 -0400	[thread overview]
Message-ID: <CAJUqKUp6zrioRy4aK_ySM+1EMWfZqX1P-_u2RGsGB9PCBXLSAQ@mail.gmail.com> (raw)
In-Reply-To: <4ab4548f-34fc-27cb-928e-af2b8ab78b1b@daenzer.net>

Thanks for your review Michel!
@MAINTAINER, could you please strip the Change-Id when applying.
Thanks!

On Fri, Aug 13, 2021 at 3:33 AM Michel Dänzer <michel@daenzer.net> wrote:
>
> On 2021-08-12 9:49 p.m., Mark Yacoub wrote:
> > From: Mark Yacoub <markyacoub@google.com>
> >
> > [Why]
> > Userspace should get back a copy of drm_wait_vblank that's been modified
> > even when drm_wait_vblank_ioctl returns a failure.
> >
> > Rationale:
> > drm_wait_vblank_ioctl modifies the request and expects the user to read
> > it back. When the type is RELATIVE, it modifies it to ABSOLUTE and updates
> > the sequence to become current_vblank_count + sequence (which was
> > RELATIVE), but now it became ABSOLUTE.
> > drmWaitVBlank (in libdrm) expects this to be the case as it modifies
> > the request to be Absolute so it expects the sequence to would have been
> > updated.
> >
> > The change is in compat_drm_wait_vblank, which is called by
> > drm_compat_ioctl. This change of copying the data back regardless of the
> > return number makes it en par with drm_ioctl, which always copies the
> > data before returning.
> >
> > [How]
> > Return from the function after everything has been copied to user.
> >
> > Fixes: IGT:kms_flip::modeset-vs-vblank-race-interruptible
> > Tested on ChromeOS Trogdor(msm)
> >
> > Signed-off-by: Mark Yacoub <markyacoub@chromium.org>
> > Change-Id: I98da279a5f1329c66a9d1e06b88d40b247b51313
>
> With the Gerrit Change-Id removed,
>
> Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
>
>
> --
> Earthling Michel Dänzer               |               https://redhat.com
> Libre software enthusiast             |             Mesa and X developer

  reply	other threads:[~2021-08-13 15:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-11 17:55 [PATCH] drm: Copy drm_wait_vblank request and copy_to_user before return Mark Yacoub
2021-08-12  9:26 ` Michel Dänzer
2021-08-12 19:51   ` Mark Yacoub
2021-08-12 19:49 ` [PATCH v2] drm: Copy drm_wait_vblank to user before returning Mark Yacoub
2021-08-13  7:32   ` Michel Dänzer
2021-08-13 15:48     ` Mark Yacoub [this message]
2021-08-17 17:59       ` Sean Paul

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=CAJUqKUp6zrioRy4aK_ySM+1EMWfZqX1P-_u2RGsGB9PCBXLSAQ@mail.gmail.com \
    --to=markyacoub@chromium.org \
    --cc=abhinavk@codeaurora.org \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=markyacoub@google.com \
    --cc=michel@daenzer.net \
    --cc=robdclark@chromium.org \
    --cc=seanpaul@chromium.org \
    /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.