dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Anholt <eric@anholt.net>
To: Qiang Yu <yuq825@gmail.com>
Cc: Marek Vasut <marex@denx.de>, Simon Shields <simon@lineageos.org>,
	lima@lists.freedesktop.org,
	Neil Armstrong <narmstrong@baylibre.com>,
	Maxime Ripard <maxime.ripard@bootlin.com>,
	David Airlie <airlied@linux.ie>,
	dri-devel <dri-devel@lists.freedesktop.org>,
	Vasily Khoruzhick <anarsoul@gmail.com>,
	Andreas Baierl <ichgeh@imkreisrum.de>,
	Sean Paul <sean@poorly.run>, Erico Nunes <nunes.erico@gmail.com>
Subject: Re: [PATCH 2/2] drm/lima: driver for ARM Mali4xx GPUs
Date: Thu, 07 Feb 2019 11:38:47 -0800	[thread overview]
Message-ID: <87wombmlrs.fsf@anholt.net> (raw)
In-Reply-To: <CAKGbVbsBa_jWUnZ7r9L0dhiQ11JA3gdQWgs4jdtWh64egByyeg@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 2309 bytes --]

Qiang Yu <yuq825@gmail.com> writes:

> On Thu, Feb 7, 2019 at 3:17 AM Eric Anholt <eric@anholt.net> wrote:
>>
>> Qiang Yu <yuq825@gmail.com> writes:
>> > +int lima_gem_wait(struct drm_file *file, u32 handle, u32 op, u64 timeout_ns)
>> > +{
>> > +     bool write = op & LIMA_GEM_WAIT_WRITE;
>> > +     struct drm_gem_object *obj;
>> > +     struct lima_bo *bo;
>> > +     signed long ret;
>> > +     unsigned long timeout;
>> > +
>> > +     obj = drm_gem_object_lookup(file, handle);
>> > +     if (!obj)
>> > +             return -ENOENT;
>> > +
>> > +     bo = to_lima_bo(obj);
>> > +
>> > +     timeout = timeout_ns ? lima_timeout_to_jiffies(timeout_ns) : 0;
>> > +
>> > +     ret = lima_bo_reserve(bo, true);
>> > +     if (ret)
>> > +             goto out;
>> > +
>> > +     /* must use long for result check because in 64bit arch int
>> > +      * will overflow if timeout is too large and get <0 result
>> > +      */
>> > +     ret = reservation_object_wait_timeout_rcu(bo->tbo.resv, write, true, timeout);
>> > +     if (ret == 0)
>> > +             ret = timeout ? -ETIMEDOUT : -EBUSY;
>> > +     else if (ret > 0)
>> > +             ret = 0;
>> > +
>> > +     lima_bo_unreserve(bo);
>> > +out:
>> > +     drm_gem_object_put_unlocked(obj);
>> > +     return ret;
>> > +}
>>
>> From Documentation/botching-up-ioctls.txt:
>>
>>  * For timeouts, use absolute times. If you're a good fellow and made your
>>    ioctl restartable relative timeouts tend to be too coarse and can
>>    indefinitely extend your wait time due to rounding on each restart.
>>    Especially if your reference clock is something really slow like the display
>>    frame counter. With a spec lawyer hat on this isn't a bug since timeouts can
>>    always be extended - but users will surely hate you if their neat animations
>>    starts to stutter due to this.
>>
>> (I made v3d's timeouts relative, but decrement the timeout value the
>> user passed by how much I waited so that the timeout probably gets
>> reduced after a restartable signal.  I should have done absolute.)
> timeout_ns in lima is already an absolute one which will be converted to
> relative one in lima_timeout_to_jiffies, is this what you want or I miss
> understand?

Yeah, not sure how I missed the lima function, wich is clearly doing
absolute.  Sorry!

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

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2019-02-07 19:38 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-06 13:14 [PATCH 0/2] Lima DRM driver Qiang Yu
2019-02-06 13:14 ` [PATCH 1/2] drm/fourcc: add ARM tiled format modifier Qiang Yu
2019-02-14 15:26   ` Brian Starkey
2019-02-14 15:34     ` Daniel Vetter
2019-02-15  1:48     ` Qiang Yu via dri-devel
2019-02-15 11:30       ` Brian Starkey
2019-02-06 13:14 ` [PATCH 2/2] drm/lima: driver for ARM Mali4xx GPUs Qiang Yu
2019-02-06 19:17   ` Eric Anholt
2019-02-07  8:27     ` Qiang Yu
2019-02-07 19:38       ` Eric Anholt [this message]
2019-02-12 15:46   ` Rob Herring via dri-devel
2019-02-12 16:23     ` Alex Deucher via dri-devel
2019-02-12 20:04       ` Rob Herring via dri-devel
2019-02-13  1:13         ` Qiang Yu via dri-devel
2019-02-14  2:52         ` Alex Deucher via dri-devel
2019-02-14  9:12           ` Christian König via dri-devel
2019-02-14 10:15             ` Daniel Vetter
2019-03-14 20:44             ` Dave Airlie
2019-03-14 21:44               ` Rob Herring
2019-03-14 22:28                 ` Eric Anholt
2019-03-15  8:06                   ` Koenig, Christian
2019-03-15 16:05                     ` Eric Anholt
2019-03-15 16:19                       ` Koenig, Christian
2019-02-13  0:56     ` Qiang Yu via dri-devel
2019-02-13  1:46       ` Rob Herring via dri-devel
2019-02-07  9:09 ` [PATCH 0/2] Lima DRM driver Daniel Vetter
2019-02-07  9:39   ` Christian König
2019-02-07 15:33     ` Qiang Yu
2019-02-07 19:14       ` Koenig, Christian
2019-02-07 15:21   ` Qiang Yu
2019-02-07 15:44     ` Alyssa Rosenzweig
2019-02-07 15:51     ` Daniel Vetter
2019-02-11 18:11       ` Rob Herring
2019-02-13  1:00         ` Eric Anholt
2019-02-13  1:44           ` Rob Herring via dri-devel
2019-02-13  7:59             ` Daniel Vetter
2019-02-13  8:35               ` Christian König via dri-devel
2019-02-13  9:38                 ` Daniel Vetter
2019-02-13 10:09                   ` Christian König via dri-devel
2019-02-26 15:58                 ` Daniel Vetter
2019-02-26 16:23                   ` Christian König
2019-02-14 21:15             ` Noralf Trønnes

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=87wombmlrs.fsf@anholt.net \
    --to=eric@anholt.net \
    --cc=airlied@linux.ie \
    --cc=anarsoul@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=ichgeh@imkreisrum.de \
    --cc=lima@lists.freedesktop.org \
    --cc=marex@denx.de \
    --cc=maxime.ripard@bootlin.com \
    --cc=narmstrong@baylibre.com \
    --cc=nunes.erico@gmail.com \
    --cc=sean@poorly.run \
    --cc=simon@lineageos.org \
    --cc=yuq825@gmail.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