dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: "Michel Dänzer" <michel@daenzer.net>
To: Mark Yacoub <markyacoub@chromium.org>, dri-devel@lists.freedesktop.org
Cc: seanpaul@chromium.org, abhinavk@codeaurora.org,
	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 09:32:56 +0200	[thread overview]
Message-ID: <4ab4548f-34fc-27cb-928e-af2b8ab78b1b@daenzer.net> (raw)
In-Reply-To: <20210812194917.1703356-1-markyacoub@chromium.org>

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  7:33 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 [this message]
2021-08-13 15:48     ` Mark Yacoub
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=4ab4548f-34fc-27cb-928e-af2b8ab78b1b@daenzer.net \
    --to=michel@daenzer.net \
    --cc=abhinavk@codeaurora.org \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=markyacoub@chromium.org \
    --cc=markyacoub@google.com \
    --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 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).