<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/include/drm/drm_gem.h, branch v5.10.78</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v5.10.78</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v5.10.78'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2020-07-15T12:02:42+00:00</updated>
<entry>
<title>drm: drm_gem.h: delete duplicated words in comments</title>
<updated>2020-07-15T12:02:42+00:00</updated>
<author>
<name>Randy Dunlap</name>
<email>rdunlap@infradead.org</email>
</author>
<published>2020-07-15T05:23:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f621f3bb33af0f92b58a2e5987f897e4f74ad028'/>
<id>urn:sha1:f621f3bb33af0f92b58a2e5987f897e4f74ad028</id>
<content type='text'>
Drop the doubled words "the" and "by" in comments.

Signed-off-by: Randy Dunlap &lt;rdunlap@infradead.org&gt;
Cc: David Airlie &lt;airlied@linux.ie&gt;
Cc: Daniel Vetter &lt;daniel@ffwll.ch&gt;
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20200715052349.23319-3-rdunlap@infradead.org
</content>
</entry>
<entry>
<title>drm: Restore the NULL check for drm_gem_object_put()</title>
<updated>2020-05-20T16:05:07+00:00</updated>
<author>
<name>Chris Wilson</name>
<email>chris@chris-wilson.co.uk</email>
</author>
<published>2020-05-20T14:23:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=0e799e840a07e9cd843149be6811fd895d20a5a0'/>
<id>urn:sha1:0e799e840a07e9cd843149be6811fd895d20a5a0</id>
<content type='text'>
Some users want to pass NULL to drm_gem_object_put(), but those using
__drm_gem_object_put() did not. Compromise, have both and let the
compiler sort it out.

drm_gem_fb_destroy() calls drm_gem_object_put() with NULL obj causing:
[   11.584209] BUG: kernel NULL pointer dereference, address: 0000000000000000
[   11.584213] #PF: supervisor write access in kernel mode
[   11.584215] #PF: error_code(0x0002) - not-present page
[   11.584216] PGD 0 P4D 0
[   11.584220] Oops: 0002 [#1] SMP NOPTI
[   11.584223] CPU: 7 PID: 1571 Comm: gnome-shell Tainted: G            E     5.7.0-rc1-1-default+ #27
[   11.584225] Hardware name: Micro-Star International Co., Ltd. MS-7A31/X370 XPOWER GAMING TITANIUM (MS-7A31), BIOS 1.MR 12/03/2019
[   11.584237] RIP: 0010:drm_gem_fb_destroy+0x28/0x70 [drm_kms_helper]
&lt;snip&gt;
[   11.584256] Call Trace:
[   11.584279]  drm_mode_rmfb+0x189/0x1c0 [drm]
[   11.584299]  ? drm_mode_rmfb+0x1c0/0x1c0 [drm]
[   11.584314]  drm_ioctl_kernel+0xaa/0xf0 [drm]
[   11.584329]  drm_ioctl+0x1ff/0x3b0 [drm]
[   11.584347]  ? drm_mode_rmfb+0x1c0/0x1c0 [drm]
[   11.584421]  amdgpu_drm_ioctl+0x49/0x80 [amdgpu]
[   11.584427]  ksys_ioctl+0x87/0xc0
[   11.584430]  __x64_sys_ioctl+0x16/0x20
[   11.584434]  do_syscall_64+0x5f/0x240
[   11.584438]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
[   11.584440] RIP: 0033:0x7f0ef80f7227

Reported-by: Nirmoy Das &lt;nirmoy.das@amd.com&gt;
Fixes: b5d250744ccc ("drm/gem: fold drm_gem_object_put_unlocked and __drm_gem_object_put()")
Signed-off-by: Chris Wilson &lt;chris@chris-wilson.co.uk&gt;
Cc: Nirmoy Das &lt;nirmoy.das@amd.com&gt;
Cc: Emil Velikov &lt;emil.velikov@collabora.com&gt;
Cc: Christian König &lt;christian.koenig@amd.com&gt;.
Acked-by: Nirmoy Das &lt;nirmoy.das@amd.com&gt;
Reviewed-by: Emil Velikov &lt;emil.velikov@collabora.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20200520142347.29060-1-chris@chris-wilson.co.uk
</content>
</entry>
<entry>
<title>drm: remove transient drm_gem_object_put_unlocked()</title>
<updated>2020-05-19T21:31:37+00:00</updated>
<author>
<name>Emil Velikov</name>
<email>emil.velikov@collabora.com</email>
</author>
<published>2020-05-15T09:51:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ab15d56e27be47b7feebffd6e8319ece01959fbf'/>
<id>urn:sha1:ab15d56e27be47b7feebffd6e8319ece01959fbf</id>
<content type='text'>
As of last commit, all the drivers have been updated away from the
_unlocked helper. As such we can now remove the transient #define.

v2: keep sed and #define removal separate

Cc: David Airlie &lt;airlied@linux.ie&gt;
Cc: Daniel Vetter &lt;daniel@ffwll.ch&gt;
Signed-off-by: Emil Velikov &lt;emil.velikov@collabora.com&gt;
Acked-by: Sam Ravnborg &lt;sam@ravnborg.org&gt; (v1)
Acked-by: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20200515095118.2743122-39-emil.l.velikov@gmail.com
</content>
</entry>
<entry>
<title>drm: remove _unlocked suffix in drm_gem_object_put_unlocked</title>
<updated>2020-05-19T21:31:31+00:00</updated>
<author>
<name>Emil Velikov</name>
<email>emil.velikov@collabora.com</email>
</author>
<published>2020-05-15T09:50:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=be6ee102341bc4d07e050dda119ecb91229bc654'/>
<id>urn:sha1:be6ee102341bc4d07e050dda119ecb91229bc654</id>
<content type='text'>
Spelling out _unlocked for each and every driver is a annoying.
Especially if we consider how many drivers, do not know (or need to)
about the horror stories involving struct_mutex.

Just drop the suffix. It makes the API cleaner.

Done via the following script:

__from=drm_gem_object_put_unlocked
__to=drm_gem_object_put
for __file in $(git grep --name-only $__from); do
  sed -i  "s/$__from/$__to/g" $__file;
done

Pay special attention to the compat #define

v2: keep sed and #define removal separate

Cc: David Airlie &lt;airlied@linux.ie&gt;
Cc: Daniel Vetter &lt;daniel@ffwll.ch&gt;
Signed-off-by: Emil Velikov &lt;emil.velikov@collabora.com&gt;
Acked-by: Sam Ravnborg &lt;sam@ravnborg.org&gt; (v1)
Reviewed-by: Steven Price &lt;steven.price@arm.com&gt;
Acked-by: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20200515095118.2743122-14-emil.l.velikov@gmail.com
</content>
</entry>
<entry>
<title>drm/gem: add drm_gem_object_put helper</title>
<updated>2020-05-19T21:31:31+00:00</updated>
<author>
<name>Emil Velikov</name>
<email>emil.velikov@collabora.com</email>
</author>
<published>2020-05-15T09:50:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2f4dd13d4bb8a85f6d5b66a18989509924e4f5e9'/>
<id>urn:sha1:2f4dd13d4bb8a85f6d5b66a18989509924e4f5e9</id>
<content type='text'>
Spelling out _unlocked for each and every driver is a annoying.
Especially if we consider how many drivers, do not know (or need to)
about the horror stories involving struct_mutex.

Add helper, which will allow us to transition the drivers one by one,
dropping the suffix.

v2: add missing space after function name (Jani)

Signed-off-by: Emil Velikov &lt;emil.velikov@collabora.com&gt;
Acked-by: Sam Ravnborg &lt;sam@ravnborg.org&gt; (v1)
Reviewed-by: Steven Price &lt;steven.price@arm.com&gt;
Acked-by: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20200515095118.2743122-13-emil.l.velikov@gmail.com
</content>
</entry>
<entry>
<title>drm/gem: add _locked suffix to drm_gem_object_put</title>
<updated>2020-05-19T21:31:30+00:00</updated>
<author>
<name>Emil Velikov</name>
<email>emil.velikov@collabora.com</email>
</author>
<published>2020-05-15T09:50:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=eecd7fd8bf58d5d59f948d2655e41760d7cf17d9'/>
<id>urn:sha1:eecd7fd8bf58d5d59f948d2655e41760d7cf17d9</id>
<content type='text'>
Vast majority of DRM (core and drivers) are struct_mutex free.

As such we have only a handful of cases where the locked helper should
be used. Make that stand out a little bit better.

Done via the following script:

__from=drm_gem_object_put
__to=drm_gem_object_put_locked

for __file in $(git grep --name-only --word-regexp $__from); do
  sed -i  "s/\&lt;$__from\&gt;/$__to/g" $__file;
done

Cc: Rob Clark &lt;robdclark@gmail.com&gt;
Cc: Sean Paul &lt;sean@poorly.run&gt;
Cc: linux-arm-msm@vger.kernel.org
Signed-off-by: Emil Velikov &lt;emil.velikov@collabora.com&gt;
Acked-by: Sam Ravnborg &lt;sam@ravnborg.org&gt;
Reviewed-by: Steven Price &lt;steven.price@arm.com&gt;
Acked-by: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20200515095118.2743122-12-emil.l.velikov@gmail.com
</content>
</entry>
<entry>
<title>drm/gem: fold drm_gem_object_put_unlocked and __drm_gem_object_put()</title>
<updated>2020-05-19T21:31:30+00:00</updated>
<author>
<name>Emil Velikov</name>
<email>emil.velikov@collabora.com</email>
</author>
<published>2020-05-15T09:50:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b5d250744cccfb40024de663ea1f4da04e6d959c'/>
<id>urn:sha1:b5d250744cccfb40024de663ea1f4da04e6d959c</id>
<content type='text'>
With earlier patch we removed the overhead so now we can lift the helper
into the header effectively folding it with __drm_object_put.

v2: drop struct_mutex references (Daniel)

Signed-off-by: Emil Velikov &lt;emil.velikov@collabora.com&gt;
Acked-by: Sam Ravnborg &lt;sam@ravnborg.org&gt; (v1)
Reviewed-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Acked-by: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20200515095118.2743122-11-emil.l.velikov@gmail.com
</content>
</entry>
<entry>
<title>drm: remove drm_driver::gem_free_object</title>
<updated>2020-05-19T21:31:30+00:00</updated>
<author>
<name>Emil Velikov</name>
<email>emil.velikov@collabora.com</email>
</author>
<published>2020-05-15T09:50:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1a9458aeb8eb48bfa5f9b3e7682bddc28fd0b85e'/>
<id>urn:sha1:1a9458aeb8eb48bfa5f9b3e7682bddc28fd0b85e</id>
<content type='text'>
No drivers set the callback, so remove it all together.

Signed-off-by: Emil Velikov &lt;emil.velikov@collabora.com&gt;
Acked-by: Sam Ravnborg &lt;sam@ravnborg.org&gt;
Reviewed-by: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Reviewed-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20200515095118.2743122-10-emil.l.velikov@gmail.com
</content>
</entry>
<entry>
<title>drm: call drm_gem_object_funcs.mmap with fake offset</title>
<updated>2019-12-06T10:18:11+00:00</updated>
<author>
<name>Gerd Hoffmann</name>
<email>kraxel@redhat.com</email>
</author>
<published>2019-11-27T09:25:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e5516553999f7352bce3d921441b1288eb0a1bb7'/>
<id>urn:sha1:e5516553999f7352bce3d921441b1288eb0a1bb7</id>
<content type='text'>
The fake offset is going to stay, so change the calling convention for
drm_gem_object_funcs.mmap to include the fake offset.  Update all users
accordingly.

Note that this reverts 83b8a6f242ea ("drm/gem: Fix mmap fake offset
handling for drm_gem_object_funcs.mmap") and on top then adds the fake
offset to  drm_gem_prime_mmap to make sure all paths leading to
obj-&gt;funcs-&gt;mmap are consistent.

v3: move fake-offset tweak in drm_gem_prime_mmap() so we have this code
    only once in the function (Rob Herring).

Fixes: 83b8a6f242ea ("drm/gem: Fix mmap fake offset handling for drm_gem_object_funcs.mmap")
Cc: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Cc: Rob Herring &lt;robh@kernel.org&gt;
Signed-off-by: Gerd Hoffmann &lt;kraxel@redhat.com&gt;
Reviewed-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Link: http://patchwork.freedesktop.org/patch/msgid/20191127092523.5620-2-kraxel@redhat.com
</content>
</entry>
<entry>
<title>drm/gem: Fix mmap fake offset handling for drm_gem_object_funcs.mmap</title>
<updated>2019-10-29T18:29:21+00:00</updated>
<author>
<name>Rob Herring</name>
<email>robh@kernel.org</email>
</author>
<published>2019-10-24T19:18:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=83b8a6f242ea6b4eafe69afcd0bfa428235f2ee4'/>
<id>urn:sha1:83b8a6f242ea6b4eafe69afcd0bfa428235f2ee4</id>
<content type='text'>
Commit c40069cb7bd6 ("drm: add mmap() to drm_gem_object_funcs")
introduced a GEM object mmap() hook which is expected to subtract the
fake offset from vm_pgoff. However, for mmap() on dmabufs, there is not
a fake offset.

To fix this, let's always call mmap() object callback with an offset of 0,
and leave it up to drm_gem_mmap_obj() to remove the fake offset.

TTM still needs the fake offset, so we have to add it back until that's
fixed.

Fixes: c40069cb7bd6 ("drm: add mmap() to drm_gem_object_funcs")
Cc: Gerd Hoffmann &lt;kraxel@redhat.com&gt;
Cc: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Signed-off-by: Rob Herring &lt;robh@kernel.org&gt;
Acked-by: Gerd Hoffmann &lt;kraxel@redhat.com&gt;
Reviewed-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20191024191859.31700-1-robh@kernel.org
</content>
</entry>
</feed>
