summaryrefslogtreecommitdiff
path: root/freedreno
AgeCommit message (Collapse)AuthorFilesLines
2021-02-23freedreno/msm: fix __u64 printing formatSeung-Woo Kim1-1/+1
__u64 is always unsigned long long, so print with %llu instead of PRIu64 for uint64_t. Change-Id: Ic88578b626cb7e05fb5829955e0d10cb77b1be2b Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
2019-11-11freedreno: convert to new symbols checkEric Engestrom2-23/+7
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
2019-11-11freedreno: drop leftover symbol from the export listEric Engestrom1-1/+0
Fixes: 09cbccff558988c57e52 ("freedreno: remove deprecated ringmarker API") Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
2019-10-18Revert "Revert "libdrm: remove autotools support""Eric Engestrom1-33/+0
The external tooling issue has been fixed, so we can delete autotools again :)
2019-10-16Revert "libdrm: remove autotools support"Marek Olšák1-0/+33
This reverts commit f057dc91e93ae21e11ab48a26127d569972f3eae.
2019-10-14libdrm: remove autotools supportEric Engestrom1-33/+0
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com> Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
2019-10-04*-symbols-check: let meson figure out how to execute the scriptsEric Engestrom1-2/+2
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
2019-10-04*-symbols-check: use normal shell over bashEmil Velikov1-1/+1
None of the tests are bash specific. Tested with bash, zsh, dash, mksh and ksh. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Tested-by: Niclas Zeising <zeising@daemonic.se> Reviewed-by: Niclas Zeising <zeising@daemonic.se> Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
2019-04-17fix various typosEric Engestrom2-2/+2
Saw a couple of typos fixes in the patch DragonFlyBSD carries [1], so I ran codespell (a spell checker for code) on the whole repo. [1] https://github.com/DragonFlyBSD/DPorts/blob/master/graphics/libdrm/files/patch-xf86drm.c Signed-off-by: Eric Engestrom <eric.engestrom@intel.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2019-02-19freedreno: revert bad freedreno/atomic_ops commitsEric Engestrom1-1/+2
This reverts 6d2379857b6fccc1cade "xf86atomic: #undef internal define" and b541d21a0a908bf98d44 "freedreno: remove always-defined #ifdef". I didn't realise at the time that freedreno/freedreno_ringbuffer.h gets installed, and then used by Mesa for instance. These two commits were fine in libdrm, but broke Mesa which needs to use struct fd_ringbuffer but doesn't need to access ::refcnt. The hack that I removed serves to keep the struct at the correct size while only exposing the ::refcnt member within libdrm. Fixes: 6d2379857b6fccc1cade "xf86atomic: #undef internal define" Fixes: b541d21a0a908bf98d44 "freedreno: remove always-defined #ifdef" Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
2019-01-03freedreno: remove always-defined #ifdefEric Engestrom1-2/+1
While at it, let's include xf86atomic.h explicitly, instead of relying on some other file accidentally including it before including this file. Signed-off-by: Eric Engestrom <eric.engestrom@intel.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2018-10-14freedreno/msm: fix c90 warningRob Clark1-1/+2
Wasn't really sure how to switch the silly -Wdeclaration-after-statement flag off on a per directory basis. So make the code uglier instead.
2018-10-14freedreno/kgsl: fix buildRob Clark1-0/+1
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2018-10-13freedreno/msm: handle ring-reloc to other stateobjsRob Clark1-4/+29
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2018-10-13freedreno/msm: simplify msm_ringbuffer_flush()Rob Clark1-19/+2
Now that it doesn't have to deal with ringmarkers we can simplify the reloc handling. Signed-off-by: Rob Clark <robclark@freedesktop.org>
2018-10-13freedreno/msm: use hashtable to track submit.cmds tableRob Clark1-14/+50
With streaming stateobjs to upload uniforms, the submit.cmds table gets much larger, and iterating over it for each ring to ring reloc starts getting expensive. TODO if we have flag to pass when constructing parent rb, we could avoid dynamically allocating this and bo_table in get_cmd() or bo2idx Signed-off-by: Rob Clark <robclark@freedesktop.org>
2018-10-13freedreno/msm: simplify emit_reloc_ring() vfuncRob Clark4-12/+9
Now that it doesn't have to deal with the ringmarker case, we can make some simplifications. Signed-off-by: Rob Clark <robclark@freedesktop.org>
2018-10-13freedreno/msm: remove reset of linked ringsRob Clark2-8/+1
The msm_cmd isn't refcount'd, so with stateobj rb's that have independent lifecycle, this is no longer a safe thing to do. Really, now that there is a bo-cache for rb's, fd_ringbuffer_reset() should be deprecated because it adds a bunch of pointless complexity. Signed-off-by: Rob Clark <robclark@freedesktop.org>
2018-10-13freedreno: remove deprecated ringmarker APIRob Clark4-77/+0
It's usage in mesa was removed more than two years ago. And it stands in the way of some optimizations needed to reduce the overhead of hw stateobjs (ie. CP_SET_DRAW_STATE, where the # of cmds in the submit ioctl goes up significantly). Signed-off-by: Rob Clark <robclark@freedesktop.org>
2018-10-13freedreno/msm: support suballocation for stateobj rb'sRob Clark4-18/+101
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2018-10-13freedreno: add flags param for rb creationRob Clark4-14/+25
For now, we want a way for gallium to be able to provide hints for the upcoming rb suballocation. But could be useful for other things down the road. Signed-off-by: Rob Clark <robclark@freedesktop.org>
2018-10-13freedreno: expose refcnt'ing on ringbuffersRob Clark5-21/+36
Move this out of msm_ringbuffer backend so that the gallium driver can refcnt rb's Signed-off-by: Rob Clark <robclark@freedesktop.org>
2018-10-13freedreno/msm: get rid of ring_bo unref hackRob Clark1-10/+1
Since 28328298 'freedreno: move ring_cache behind fd_bo_del()' this hack is no longer necessary. Signed-off-by: Rob Clark <robclark@freedesktop.org>
2018-10-04*-symbols-check: error out when using unset variablesEmil Velikov1-0/+2
It will make bugs like the one fixed with previous patch dead obvious. Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
2018-10-04automake: set NM before running the testsEmil Velikov1-0/+1
Set/export the NM variable since it may not be set already. Fixes: 4f08bfe96da ("*-symbol-check: Don't hard-code nm executable") Cc: Heiko Becker <heirecka@exherbo.org> Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
2018-09-20freedreno: add missing drm_publicEric Engestrom1-1/+1
Fixes: 9a1470fb410bbc840459 "freedreno: annotate public functions" Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
2018-09-19autotools: make symbols hidden by defaultLucas De Marchi1-0/+1
Now that symbols that should be exported are annotated accordingly, make all the rest hidden by default. Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> Acked-by: Eric Engestrom <eric.engestrom@intel.com>
2018-09-19meson: make symbols hidden by defaultLucas De Marchi1-1/+1
Now that symbols that should be exported are annotated accordingly, make all the rest hidden by default. Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> Reviewed-by: Dylan Baker <dylan@pnwbakers.com> Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
2018-09-19freedreno: annotate public functionsLucas De Marchi4-49/+49
while read sym; do read f func line _ <<<$(cscope -d -L -1 $sym) if [ ! -z "$f" ]; then sed -i "${line}s/^/drm_public /" $f fi done < /tmp/a.txt In which /tmp/a.txt contains the public symbols from freedreno-symbol-check. The idea here will be to switch the default visibility to hidden so we don't export symbols we shouldn't. Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> Acked-by: Eric Engestrom <eric.engestrom@intel.com>
2018-09-14freedreno: move ring_cache behind fd_bo_del()Rob Clark5-48/+45
So that it isn't bypassing normal refcnt'ing. Signed-off-by: Rob Clark <robclark@freedesktop.org>
2018-09-14freedreno: fix spelling typoRob Clark1-3/+3
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2018-08-23libdrm: add msm drm uapi headerTanmay Shah2-308/+0
msm_drm.h file Generated using make headers_install. Generated from tree - git://people.freedesktop.org/~airlied/linux branch - drm-next commit - 6d08b06e67cd117f6992c46611dfb4ce267cd71e Remove freedreno/msm/msm_drm.h to maintain only one copy of msm_drm.h and change freedreno Makefile and meson.build file accordingly. v2: Remove private freedreno/msm/msm_drm.h v3: meson.build update v3: README update (by anholt) Signed-off-by: Tanmay Shah <tanmay@codeaurora.org> Reviewed-by: Eric Anholt <eric@anholt.net>
2018-08-08freedreno: fix use-after-free with stateobj rb'sRob Clark1-1/+15
We could be dropping last reference in ->flush(), so clear the entry in the parent rb's table to avoid deref'ing after free'd. Also, ring_bo_del()'s use of ring_cache expects that it is dropping the last reference. So drop our ref to the stateobj's ring_bo first. Signed-off-by: Rob Clark <robclark@freedesktop.org>
2018-08-08freedreno: don't leak stateobj rb refsRob Clark1-4/+11
One stateobj can be emitted multiple times in a single cmdstream, but only the first time is a cmd entry added to the parent. Since it will be only unref'd once after flush, we should only ref it the first time it is emitted (ie. the time it is added to cmd table). Signed-off-by: Rob Clark <robclark@freedesktop.org>
2018-07-30freedreno/msm: "stateobj" supportRob Clark2-8/+84
Adds support for "state object" cmdstream buffers which can be constructed once, and re-used many times. This enables the use for CP_SET_DRAW_STATE packets on newer hardware, to lower the CPU overhead. Signed-off-by: Rob Clark <robclark@freedesktop.org>
2018-07-30freedreno: slight reorderingRob Clark1-6/+6
Splitting code-motion out from next patch. Once we add stateobj rb's this loop could add new entries to bos table, so it needs to be before we set req.bos/req.nr_bos. Signed-off-by: Rob Clark <robclark@freedesktop.org>
2018-07-30freedreno: small cleanupRob Clark2-27/+31
Make cheezy growable array thing less open-coded before adding more. Signed-off-by: Rob Clark <robclark@freedesktop.org>
2018-07-30freedreno: add fd_ringbuffer_new_object()Rob Clark8-10/+62
Add new API for reusable "state objects" which can be re-used multiple times. Backend implementation for msm will follow. (Probably not needed to support this for any device that uses kgsl backend, since this is mostly useful for a5xx+.) Signed-off-by: Rob Clark <robclark@freedesktop.org>
2018-06-18freedreno: add user ptr to fd_ringbufferRob Clark1-0/+5
Something for users of fd_ringbuffer to use as they see fit. (For now, just so mesa can add some debugging state.) Signed-off-by: Rob Clark <robclark@freedesktop.org>
2018-05-09freedreno: add fd_pipe refcountingRob Clark4-0/+12
In mesa/gallium, a pipe_fence can outlive the pipe_context it was created from. But to wait on the fence we need to know the submit- queue (ie. the fd_pipe). The most straightforward way to fix this is to add reference counting to the fd_pipe and let the fence hold a reference to the pipe (rather than hanging on to the context, which might have been destroyed before the fence). Signed-off-by: Rob Clark <robclark@freedesktop.org>
2018-03-20meson,configure: include config.h automaticallyEric Engestrom14-56/+0
This will prevent any more missing `#include "config.h"` bug, at the cost of having to recompile some files that didn't need to be when changing build options. Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2018-03-09meson: use pkg-config to detect libatomic_opsEric Engestrom1-1/+1
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2018-03-08freedreno: add missing symbols to symbol-checkEric Engestrom1-0/+2
Fixes: 1384c081233751569473 "freedreno: add interface to get buffer address" Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
2018-02-26freedreno: add interface to get buffer addressRob Clark4-0/+27
Needed for clover/OpenCL. Fortunately the kernel interface is already in place. Include a stub _put_iova() so mesa can tell us when it no longer needs the buffer to be pinned. There is no kernel interface for this (yet), but at least if we want to unpin buffers we won't need mesa changes. Signed-off-by: Rob Clark <robclark@freedesktop.org>
2018-02-23*-symbol-check: Don't hard-code nm executableHeiko Becker2-1/+2
Helpful if your nm executable has a prefix based on the architecture, for example. Signed-off-by: Heiko Becker <heirecka@exherbo.org> Cc: Timo Gurr <timo.gurr@gmail.com> [Eric: v2: rebase and add Meson support] Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com> Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2018-01-29always define HAVE_VALGRINDEric Engestrom1-1/+1
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
2018-01-29always define HAVE_FREEDRENO_KGSLEric Engestrom2-2/+2
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
2018-01-26freedreno: clamp priority based on # of ringsRob Clark2-12/+18
In case of a kernel that is new enough to support multiple submit- queues, but with an adreno generation which doesn't support multiple prioritized ringbuffers, we'd attempt to open a submit-queue with prio=1 (medium), which is rejected by the kernel. This could happen either w/ an older mesa (which uses fd_pipe_new()) or a newer mesa which defaults to prio=1 if no pipe context priority flags are set. The simple answer to fix both cases is to clamp the requested priority according to the number of rings. This might not do exactly what you want, if we hypothetically had 2 rings (it would result in requested medium priority being high priority instead of low priority). But the number of rings (for hw gen's that support this) is purely a software construct, so the easy answer there is to have the kernel advertise at least 3 rings if it supports more than one. There isn't really any reason to do otherwise. Signed-off-by: Rob Clark <robclark@freedesktop.org>
2018-01-25meson: set proper pkg-config version for libdrm_freedrenoDylan Baker1-1/+1
Copy and paste error from exynos. Signed-off-by: Dylan Baker <dylan.c.baker@intel.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2018-01-12Add meson build systemDylan Baker1-0/+76
This patch adds a complete meson build system, including tests and install. It has the necessary hooks to allow it be used as a subproject for other meson based builds such as mesa. Signed-off-by: Dylan Baker <dylan.c.baker@intel.com> Reviewed-and-tested-by: Igor Gnatenko <i.gnatenko.brain@gmail.com> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>