<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/gpu/drm/drm_syncobj.c, branch v6.7</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v6.7</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v6.7'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2023-10-26T19:20:25Z</updated>
<entry>
<title>drm/syncobj: fix DRM_SYNCOBJ_WAIT_FLAGS_WAIT_AVAILABLE</title>
<updated>2023-10-26T19:20:25Z</updated>
<author>
<name>Erik Kurzinger</name>
<email>ekurzinger@nvidia.com</email>
</author>
<published>2023-08-16T16:26:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=101c9f637efa1655f55876644d4439e552267527'/>
<id>urn:sha1:101c9f637efa1655f55876644d4439e552267527</id>
<content type='text'>
If DRM_IOCTL_SYNCOBJ_TIMELINE_WAIT is invoked with the
DRM_SYNCOBJ_WAIT_FLAGS_WAIT_AVAILABLE flag set but no fence has yet been
submitted for the given timeline point the call will fail immediately
with EINVAL. This does not match the intended behavior where the call
should wait until the fence has been submitted (or the timeout expires).

The following small example program illustrates the issue. It should
wait for 5 seconds and then print ETIME, but instead it terminates right
away after printing EINVAL.

  #include &lt;stdio.h&gt;
  #include &lt;fcntl.h&gt;
  #include &lt;time.h&gt;
  #include &lt;errno.h&gt;
  #include &lt;xf86drm.h&gt;
  int main(void)
  {
      int fd = open("/dev/dri/card0", O_RDWR);
      uint32_t syncobj;
      drmSyncobjCreate(fd, 0, &amp;syncobj);
      struct timespec ts;
      clock_gettime(CLOCK_MONOTONIC, &amp;ts);
      uint64_t point = 1;
      if (drmSyncobjTimelineWait(fd, &amp;syncobj, &amp;point, 1,
                                 ts.tv_sec * 1000000000 + ts.tv_nsec + 5000000000, // 5s
                                 DRM_SYNCOBJ_WAIT_FLAGS_WAIT_AVAILABLE, NULL)) {
          printf("drmSyncobjTimelineWait failed %d\n", errno);
      }
  }

Fixes: 01d6c3578379 ("drm/syncobj: add support for timeline point wait v8")
Signed-off-by: Erik Kurzinger &lt;ekurzinger@nvidia.com&gt;
Reviewed by: Simon Ser &lt;contact@emersion.fd&gt;
Signed-off-by: Simon Ser &lt;contact@emersion.fr&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/1fac96f1-2f3f-f9f9-4eb0-340f27a8f6c0@nvidia.com
</content>
</entry>
<entry>
<title>Merge tag 'drm-misc-next-2023-07-21' of ssh://git.freedesktop.org/git/drm/drm-misc into drm-next</title>
<updated>2023-07-27T08:49:57Z</updated>
<author>
<name>Daniel Vetter</name>
<email>daniel.vetter@ffwll.ch</email>
</author>
<published>2023-07-27T08:49:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5c1b19b45a22820e9570da58415ebffa61e28741'/>
<id>urn:sha1:5c1b19b45a22820e9570da58415ebffa61e28741</id>
<content type='text'>
drm-misc-next for 6.6:

UAPI Changes:
  - syncobj: New DRM_IOCTL_SYNCOBJ_EVENTFD ioctl

Cross-subsystem Changes:
  - Converge to use of_device_uevent()

Core Changes:
  - GPU VA Manager
  - improvements to make it clearer that drm_minor_type is uAPI

Driver Changes:
  - ssd130x: Improve intermediate buffer size computation
  - bridges:
    - adv7511: Fix low refresh rate
    - anx7625: Switch to macros instead of hardcoded values
  - panel:
    - ld9040: Backlight support, magic improved

Signed-off-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
From: Maxime Ripard &lt;mripard@kernel.org&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/urs7omo5xnhglztxgwgsslws7duqfj4jhzrtppaenuvdh2lwuz@4htm4iiqhkep
</content>
</entry>
<entry>
<title>drm/syncobj: add IOCTL to register an eventfd</title>
<updated>2023-07-20T10:01:03Z</updated>
<author>
<name>Simon Ser</name>
<email>contact@emersion.fr</email>
</author>
<published>2023-07-14T11:13:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c7a472297169156252a50d76965eb36b081186e2'/>
<id>urn:sha1:c7a472297169156252a50d76965eb36b081186e2</id>
<content type='text'>
Introduce a new DRM_IOCTL_SYNCOBJ_EVENTFD IOCTL which signals an
eventfd from a syncobj.

This is useful for Wayland compositors to handle wait-before-submit.
Wayland clients can send a timeline point to the compositor
before the point has materialized yet, then compositors can wait
for the point to materialize via this new IOCTL.

The existing DRM_IOCTL_SYNCOBJ_TIMELINE_WAIT IOCTL is not suitable
because it blocks. Compositors want to integrate the wait with
their poll(2)-based event loop.

Requirements for new uAPI:

- User-space patch: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4262
- IGT: https://lists.freedesktop.org/archives/igt-dev/2023-July/057893.html

v2:
- Wait for fence when flags is zero
- Improve documentation (Pekka)
- Rename IOCTL (Christian)
- Fix typo in drm_syncobj_add_eventfd() (Christian)

v3:
- Link user-space + IGT patches
- Add reference from overview docs

v4: fix IOCTL number conflict with GETFB2 (Nicholas Choi, Vitaly Prosyak)

Signed-off-by: Simon Ser &lt;contact@emersion.fr&gt;
Reviewed-by: Christian König &lt;christian.koenig@amd.com&gt;
Acked-by: Pekka Paalanen &lt;pekka.paalanen@collabora.com&gt;
Cc: Jason Ekstrand &lt;jason@jlekstrand.net&gt;
Cc: Daniel Vetter &lt;daniel@ffwll.ch&gt;
Cc: Bas Nieuwenhuizen &lt;bas@basnieuwenhuizen.nl&gt;
Cc: Daniel Stone &lt;daniel@fooishbar.org&gt;
Cc: James Jones &lt;jajones@nvidia.com&gt;
Cc: Austin Shafer &lt;ashafer@nvidia.com&gt;
Cc: Vitaly Prosyak &lt;vprosyak@amd.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20230714111257.11940-1-contact@emersion.fr
</content>
</entry>
<entry>
<title>dma-buf: fix an error pointer vs NULL bug</title>
<updated>2023-07-06T14:20:23Z</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@linaro.org</email>
</author>
<published>2023-07-06T12:37:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=00ae1491f970acc454be0df63f50942d94825860'/>
<id>urn:sha1:00ae1491f970acc454be0df63f50942d94825860</id>
<content type='text'>
Smatch detected potential error pointer dereference.

    drivers/gpu/drm/drm_syncobj.c:888 drm_syncobj_transfer_to_timeline()
    error: 'fence' dereferencing possible ERR_PTR()

The error pointer comes from dma_fence_allocate_private_stub().  One
caller expected error pointers and one expected NULL pointers.  Change
it to return NULL and update the caller which expected error pointers,
drm_syncobj_assign_null_handle(), to check for NULL instead.

Fixes: f781f661e8c9 ("dma-buf: keep the signaling time of merged fences v3")
Signed-off-by: Dan Carpenter &lt;dan.carpenter@linaro.org&gt;
Reviewed-by: Christian König &lt;christian.koenig@amd.com&gt;
Reviewed-by: Sumit Semwal &lt;sumit.semwal@linaro.org&gt;
Signed-off-by: Sumit Semwal &lt;sumit.semwal@linaro.org&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/b09f1996-3838-4fa2-9193-832b68262e43@moroto.mountain
</content>
</entry>
<entry>
<title>dma-buf: keep the signaling time of merged fences v3</title>
<updated>2023-07-03T11:47:06Z</updated>
<author>
<name>Christian König</name>
<email>christian.koenig@amd.com</email>
</author>
<published>2023-06-13T08:09:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f781f661e8c99b0cb34129f2e374234d61864e77'/>
<id>urn:sha1:f781f661e8c99b0cb34129f2e374234d61864e77</id>
<content type='text'>
Some Android CTS is testing if the signaling time keeps consistent
during merges.

v2: use the current time if the fence is still in the signaling path and
the timestamp not yet available.
v3: improve comment, fix one more case to use the correct timestamp

Signed-off-by: Christian König &lt;christian.koenig@amd.com&gt;
Reviewed-by: Luben Tuikov &lt;luben.tuikov@amd.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20230630120041.109216-1-christian.koenig@amd.com
</content>
</entry>
<entry>
<title>drm/syncobj: add missing error return code in drm_syncobj_transfer_to_timeline()</title>
<updated>2022-06-13T06:54:16Z</updated>
<author>
<name>Yang Yingliang</name>
<email>yangyingliang@huawei.com</email>
</author>
<published>2022-06-13T06:34:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f4e3a12bf2d1983b8f352b7719794c52be7e0990'/>
<id>urn:sha1:f4e3a12bf2d1983b8f352b7719794c52be7e0990</id>
<content type='text'>
If dma_fence_unwrap_merge() fails, it should return error code
in drm_syncobj_transfer_to_timeline()

Fixes: ec8d985ff26f ("drm: use dma_fence_unwrap_merge() in drm_syncobj")
Reported-by: Hulk Robot &lt;hulkci@huawei.com&gt;
Signed-off-by: Yang Yingliang &lt;yangyingliang@huawei.com&gt;
Reviewed-by: Christian König &lt;christian.koenig@amd.com&gt;
Signed-off-by: Christian König &lt;christian.koenig@amd.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20220613063454.2609364-1-yangyingliang@huawei.com
</content>
</entry>
<entry>
<title>drm: use dma_fence_unwrap_merge() in drm_syncobj</title>
<updated>2022-05-30T12:30:36Z</updated>
<author>
<name>Christian König</name>
<email>christian.koenig@amd.com</email>
</author>
<published>2022-05-04T11:34:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ec8d985ff26f29d53d9ebff04973e96572fd0285'/>
<id>urn:sha1:ec8d985ff26f29d53d9ebff04973e96572fd0285</id>
<content type='text'>
The unwrap merge function is now intended for this use case.

Signed-off-by: Christian König &lt;christian.koenig@amd.com&gt;
Reviewed-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20220518135844.3338-6-christian.koenig@amd.com
</content>
</entry>
<entry>
<title>drm/syncobj: flatten dma_fence_chains on transfer</title>
<updated>2022-02-11T10:30:01Z</updated>
<author>
<name>Christian König</name>
<email>christian.koenig@amd.com</email>
</author>
<published>2022-02-09T18:13:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=721255b52700b320c4ae2e23d57f7d9ad1db50b9'/>
<id>urn:sha1:721255b52700b320c4ae2e23d57f7d9ad1db50b9</id>
<content type='text'>
It is illegal to add a dma_fence_chain as timeline point. Flatten out
the fences into a dma_fence_array instead.

Signed-off-by: Christian König &lt;christian.koenig@amd.com&gt;
Reviewed-by: Nirmoy Das &lt;nirmoy.das@linux.intel.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20220209182600.434803-1-christian.koenig@amd.com
</content>
</entry>
<entry>
<title>drm/syncobj: Deal with signalled fences in drm_syncobj_find_fence.</title>
<updated>2021-12-08T16:19:48Z</updated>
<author>
<name>Bas Nieuwenhuizen</name>
<email>bas@basnieuwenhuizen.nl</email>
</author>
<published>2021-12-08T02:39:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b19926d4f3a660a8b76e5d989ffd1168e619a5c4'/>
<id>urn:sha1:b19926d4f3a660a8b76e5d989ffd1168e619a5c4</id>
<content type='text'>
dma_fence_chain_find_seqno only ever returns the top fence in the
chain or an unsignalled fence. Hence if we request a seqno that
is already signalled it returns a NULL fence. Some callers are
not prepared to handle this, like the syncobj transfer functions
for example.

This behavior is "new" with timeline syncobj and it looks like
not all callers were updated. To fix this behavior make sure
that a successful drm_sync_find_fence always returns a non-NULL
fence.

v2: Move the fix to drm_syncobj_find_fence from the transfer
    functions.

Fixes: ea569910cbab ("drm/syncobj: add transition iotcls between binary and timeline v2")
Cc: stable@vger.kernel.org
Signed-off-by: Bas Nieuwenhuizen &lt;bas@basnieuwenhuizen.nl&gt;
Reviewed-by: Christian König &lt;christian.koenig@amd.com&gt;
Acked-by: Lionel Landwerlin &lt;lionel.g.landwerlin@intel.com&gt;
Signed-off-by: Christian König &lt;christian.koenig@amd.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20211208023935.17018-1-bas@basnieuwenhuizen.nl
</content>
</entry>
<entry>
<title>drm: Fix typo in comments</title>
<updated>2021-08-02T08:19:43Z</updated>
<author>
<name>Cai Huoqing</name>
<email>caihuoqing@baidu.com</email>
</author>
<published>2021-07-30T13:27:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0ae865ef92f1920bd2ca3fc7b6b5a9555b4641cc'/>
<id>urn:sha1:0ae865ef92f1920bd2ca3fc7b6b5a9555b4641cc</id>
<content type='text'>
fix typo for drm

v1-&gt;v2:
respin with the change "iff ==&gt; implies that"

Signed-off-by: Cai Huoqing &lt;caihuoqing@baidu.com&gt;
Signed-off-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20210730132729.376-1-caihuoqing@baidu.com
</content>
</entry>
</feed>
