<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/drivers/gpu/drm/vc4/vc4_bo.c, branch linux-4.17.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-4.17.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-4.17.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2018-04-09T19:42:08Z</updated>
<entry>
<title>drm/vc4: Fix memory leak during BO teardown</title>
<updated>2018-04-09T19:42:08Z</updated>
<author>
<name>Daniel J Blueman</name>
<email>daniel@quora.org</email>
</author>
<published>2018-04-02T07:10:35Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=c0db1b677e1d584fab5d7ac76a32e1c0157542e0'/>
<id>urn:sha1:c0db1b677e1d584fab5d7ac76a32e1c0157542e0</id>
<content type='text'>
During BO teardown, an indirect list 'uniform_addr_offsets' wasn't being
freed leading to leaking many 128B allocations. Fix the memory leak by
releasing it at teardown time.

Cc: stable@vger.kernel.org
Fixes: 6d45c81d229d ("drm/vc4: Add support for branching in shader validation.")
Signed-off-by: Daniel J Blueman &lt;daniel@quora.org&gt;
Signed-off-by: Eric Anholt &lt;eric@anholt.net&gt;
Reviewed-by: Eric Anholt &lt;eric@anholt.net&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20180402071035.25356-1-daniel@quora.org
</content>
</entry>
<entry>
<title>drm/vc4: Fix false positive WARN() backtrace on refcount_inc() usage</title>
<updated>2017-12-07T09:09:43Z</updated>
<author>
<name>Boris Brezillon</name>
<email>boris.brezillon@free-electrons.com</email>
</author>
<published>2017-11-22T20:39:28Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=5bfd40139d55790cbc8e56ad1ce4f974f1fa186d'/>
<id>urn:sha1:5bfd40139d55790cbc8e56ad1ce4f974f1fa186d</id>
<content type='text'>
With CONFIG_REFCOUNT_FULL enabled, refcount_inc() complains when it's
passed a refcount object that has its counter set to 0. In this driver,
this is a valid use case since we want to increment -&gt;usecnt only when
the BO object starts to be used by real HW components and this is
definitely not the case when the BO is created.

Fix the problem by using refcount_inc_not_zero() instead of
refcount_inc() and fallback to refcount_set(1) when
refcount_inc_not_zero() returns false. Note that this 2-steps operation
is not racy here because the whole section is protected by a mutex
which guarantees that the counter does not change between the
refcount_inc_not_zero() and refcount_set() calls.

Fixes: b9f19259b84d ("drm/vc4: Add the DRM_IOCTL_VC4_GEM_MADVISE ioctl")
Reported-by: Stefan Wahren &lt;stefan.wahren@i2se.com&gt;
Signed-off-by: Boris Brezillon &lt;boris.brezillon@free-electrons.com&gt;
Acked-by: Eric Anholt &lt;eric@anholt.net&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20171122203928.28135-1-boris.brezillon@free-electrons.com
</content>
</entry>
<entry>
<title>drm/vc4: Convert timers to use timer_setup()</title>
<updated>2017-11-21T23:46:44Z</updated>
<author>
<name>Kees Cook</name>
<email>keescook@chromium.org</email>
</author>
<published>2017-10-24T15:16:48Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=0078730f5b829226b03194332b3405314e60c81b'/>
<id>urn:sha1:0078730f5b829226b03194332b3405314e60c81b</id>
<content type='text'>
In preparation for unconditionally passing the struct timer_list pointer to
all timer callbacks, switch to using the new timer_setup() and from_timer()
to pass the timer pointer explicitly.

Cc: Eric Anholt &lt;eric@anholt.net&gt;
Cc: David Airlie &lt;airlied@linux.ie&gt;
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
Signed-off-by: Eric Anholt &lt;eric@anholt.net&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20171024151648.GA104538@beast
Reviewed-by: Eric Anholt &lt;eric@anholt.net&gt;
</content>
</entry>
<entry>
<title>drm/vc4: Fix wrong printk format in vc4_bo_stats_debugfs()</title>
<updated>2017-11-03T17:15:42Z</updated>
<author>
<name>Boris BREZILLON</name>
<email>boris.brezillon@free-electrons.com</email>
</author>
<published>2017-11-01T09:57:31Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=e073db5c5d7ad311efa8f4192a2047b006bbc5f3'/>
<id>urn:sha1:e073db5c5d7ad311efa8f4192a2047b006bbc5f3</id>
<content type='text'>
vc4-&gt;purgeable.size and vc4-&gt;purgeable.purged_size are size_t fields
and should be printed with a %zd specifier.

Fixes: b9f19259b84d ("drm/vc4: Add the DRM_IOCTL_VC4_GEM_MADVISE ioctl")
Signed-off-by: Boris Brezillon &lt;boris.brezillon@free-electrons.com&gt;
Reviewed-by: Gustavo Padovan &lt;gustavo.padovan@collabora.com&gt;
Reviewed-by: Eric Anholt &lt;eric@anholt.net&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20171101095731.14878-1-boris.brezillon@free-electrons.com
(cherry picked from commit 50f365cde4ffb5ae70c3f02384bbb46698aba65c)
Signed-off-by: Eric Anholt &lt;eric@anholt.net&gt;
</content>
</entry>
<entry>
<title>drm/vc4: Add the DRM_IOCTL_VC4_GEM_MADVISE ioctl</title>
<updated>2017-10-19T17:34:49Z</updated>
<author>
<name>Boris Brezillon</name>
<email>boris.brezillon@free-electrons.com</email>
</author>
<published>2017-10-19T12:57:48Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=b9f19259b84dc648f207a46f3581d15eeaedf4b6'/>
<id>urn:sha1:b9f19259b84dc648f207a46f3581d15eeaedf4b6</id>
<content type='text'>
This ioctl will allow us to purge inactive userspace buffers when the
system is running out of contiguous memory.

For now, the purge logic is rather dumb in that it does not try to
release only the amount of BO needed to meet the last CMA alloc request
but instead purges all objects placed in the purgeable pool as soon as
we experience a CMA allocation failure.

Note that the in-kernel BO cache is always purged before the purgeable
cache because those objects are known to be unused while objects marked
as purgeable by a userspace application/library might have to be
restored when they are marked back as unpurgeable, which can be
expensive.

Signed-off-by: Boris Brezillon &lt;boris.brezillon@free-electrons.com&gt;
Signed-off-by: Eric Anholt &lt;eric@anholt.net&gt;
Reviewed-by: Eric Anholt &lt;eric@anholt.net&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20171019125748.3152-1-boris.brezillon@free-electrons.com
</content>
</entry>
<entry>
<title>drm/vc4: Continue the switch to drm_*_put() helpers</title>
<updated>2017-08-14T21:06:46Z</updated>
<author>
<name>Cihangir Akturk</name>
<email>cakturk@gmail.com</email>
</author>
<published>2017-08-11T12:33:10Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=b9c55b6e2cc4369b0688961fa5de0e057f3ec0c4'/>
<id>urn:sha1:b9c55b6e2cc4369b0688961fa5de0e057f3ec0c4</id>
<content type='text'>
Use drm_*_get() and drm_*_put() helpers instead of drm_*_reference()
and drm_*_unreference() helpers.

drm_*_reference() and drm_*_unreference() functions are just
compatibility alias for drm_*_get() and drm_*_put() and should not be
used by new code. So convert all users of compatibility functions to
use the new APIs.

Generated by: scripts/coccinelle/api/drm-get-put.cocci

v2: Tweak commit summary to distinguish it from the previous commit
    covering everything but the new bo_label ioctl (by anholt).

Signed-off-by: Cihangir Akturk &lt;cakturk@gmail.com&gt;
Signed-off-by: Eric Anholt &lt;eric@anholt.net&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/1502454794-28558-25-git-send-email-cakturk@gmail.com
Reviewed-by: Eric Anholt &lt;eric@anholt.net&gt;
</content>
</entry>
<entry>
<title>drm/vc4: Demote user-accessible DRM_ERROR paths to DRM_DEBUG.</title>
<updated>2017-08-08T20:20:11Z</updated>
<author>
<name>Eric Anholt</name>
<email>eric@anholt.net</email>
</author>
<published>2017-07-25T16:27:32Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=fb95992af1d779806da9a380b14f76ad13764c2f'/>
<id>urn:sha1:fb95992af1d779806da9a380b14f76ad13764c2f</id>
<content type='text'>
Userspace shouldn't be able to spam dmesg by passing bad arguments.
This has particularly become an issues since we started using a bad
argument to set_tiling to detect if set_tiling was supported.

Signed-off-by: Eric Anholt &lt;eric@anholt.net&gt;
Fixes: 83753117f1de ("drm/vc4: Add get/set tiling ioctls.")
Link: https://patchwork.freedesktop.org/patch/msgid/20170725162733.28007-1-eric@anholt.net
Reviewed-by: Boris Brezillon &lt;boris.brezillon@free-electrons.com&gt;
</content>
</entry>
<entry>
<title>drm/vc4: switch to drm_*{get,put} helpers</title>
<updated>2017-08-08T20:20:11Z</updated>
<author>
<name>Cihangir Akturk</name>
<email>cakturk@gmail.com</email>
</author>
<published>2017-08-03T11:58:40Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=1d5494e965be7b512cc03d48f1bfc6a93a876121'/>
<id>urn:sha1:1d5494e965be7b512cc03d48f1bfc6a93a876121</id>
<content type='text'>
drm_*_reference() and drm_*_unreference() functions are just
compatibility alias for drm_*_get() and drm_*_put() adn should not be
used by new code. So convert all users of compatibility functions to use
the new APIs.

Signed-off-by: Cihangir Akturk &lt;cakturk@gmail.com&gt;
Signed-off-by: Eric Anholt &lt;eric@anholt.net&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/1501761585-11757-26-git-send-email-cakturk@gmail.com
Reviewed-by: Eric Anholt &lt;eric@anholt.net&gt;
</content>
</entry>
<entry>
<title>drm/vc4: Convert more lock requirement comments to lockdep assertions.</title>
<updated>2017-07-28T23:05:08Z</updated>
<author>
<name>Eric Anholt</name>
<email>eric@anholt.net</email>
</author>
<published>2017-07-25T18:27:18Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=4e6b1e91253ebf701b4ec3586cba5596527a4d0a'/>
<id>urn:sha1:4e6b1e91253ebf701b4ec3586cba5596527a4d0a</id>
<content type='text'>
Since I do my development with lockdep on, this will help make sure I
don't introduce bugs here.

Signed-off-by: Eric Anholt &lt;eric@anholt.net&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20170725182718.31468-3-eric@anholt.net
Reviewed-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
</content>
</entry>
<entry>
<title>drm/vc4: Add an ioctl for labeling GEM BOs for summary stats</title>
<updated>2017-07-28T23:04:53Z</updated>
<author>
<name>Eric Anholt</name>
<email>eric@anholt.net</email>
</author>
<published>2017-07-25T18:27:17Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=f30994622b2bf8e4fa224237ac65304b27a9cb6a'/>
<id>urn:sha1:f30994622b2bf8e4fa224237ac65304b27a9cb6a</id>
<content type='text'>
This has proven immensely useful for debugging memory leaks and
overallocation (which is a rather serious concern on the platform,
given that we typically run at about 256MB of CMA out of up to 1GB
total memory, with framebuffers that are about 8MB ecah).

The state of the art without this is to dump debug logs from every GL
application, guess as to kernel allocations based on bo_stats, and try
to merge that all together into a global picture of memory allocation
state.  With this, you can add a couple of calls to the debug build of
the 3D driver and get a pretty detailed view of GPU memory usage from
/debug/dri/0/bo_stats (or when we debug print to dmesg on allocation
failure).

The Mesa side currently labels at the gallium resource level (so you
see that a 1920x20 pixmap has been created, presumably for the window
system panel), but we could extend that to be even more useful with
glObjectLabel() names being sent all the way down to the kernel.

(partial) example of sorted debugfs output with Mesa labeling all
resources:

               kernel BO cache:  16392kb BOs (3)
       tiling shadow 1920x1080:   8160kb BOs (1)
       resource 1920x1080@32/0:   8160kb BOs (1)
scanout resource 1920x1080@32/0:   8100kb BOs (1)
                        kernel:   8100kb BOs (1)

v2: Use strndup_user(), use lockdep assertion instead of just a
    comment, fix an array[-1] reference, extend comment about name
    freeing.

Signed-off-by: Eric Anholt &lt;eric@anholt.net&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20170725182718.31468-2-eric@anholt.net
Reviewed-by: Chris Wilson &lt;chris@chris-wilson.co.uk&gt;
</content>
</entry>
</feed>
