summaryrefslogtreecommitdiff
path: root/freedreno
Commit message (Collapse)AuthorAgeFilesLines
* meson: use the modern interface for pkg.generateDylan Baker2022-01-201-3/+1
| | | | | | | | | This produces no differences in the generated output. I've had to manually add `requires : 'libdrm'` to libdrm_intel, otherwise libdrm ends up in `Requires.private` instead of `Requires`. Signed-off-by: Dylan Baker <dylan@pnwbakers.com> Reviewed-by: Simon Ser <contact@emersion.fr>
* meson: add override_dependency when possibleDylan Baker2021-12-141-0/+4
| | | | | | | | | | This allows consumers of libdrm as a subproject to use the simpler `dependency('libdrm', fallback : 'libdrm')` syntax, as the libdrm build files already tell meson that they override a dependency called "libdrm". Signed-off-by: Dylan Baker <dylan@pnwbakers.com> Reviewed-by: Simon Ser <contact@emersion.fr>
* freedreno: use drmCloseBufferHandleSimon Ser2021-10-061-8/+2
| | | | | | | | Instead of manually calling drmIoctl, use the equivalent function from libdrm core. Signed-off-by: Simon Ser <contact@emersion.fr> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
* meson: use library() instead of shared_library().Fang Tan2021-03-091-1/+1
| | | | | | | | | | This allows users to select the library type (static or shared) using the Meson -Ddefault_library built-in option. Issue: https://gitlab.freedesktop.org/mesa/drm/-/issues/45 Reviewed-by: Simon Ser <contact@emersion.fr> Signed-off-by: Fang Tan <tanfang@uniontech.com>
* freedreno: convert to new symbols checkEric Engestrom2019-11-112-23/+7
| | | | Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
* freedreno: drop leftover symbol from the export listEric Engestrom2019-11-111-1/+0
| | | | | Fixes: 09cbccff558988c57e52 ("freedreno: remove deprecated ringmarker API") Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
* Revert "Revert "libdrm: remove autotools support""Eric Engestrom2019-10-181-33/+0
| | | | | The external tooling issue has been fixed, so we can delete autotools again :)
* Revert "libdrm: remove autotools support"Marek Olšák2019-10-161-0/+33
| | | | This reverts commit f057dc91e93ae21e11ab48a26127d569972f3eae.
* libdrm: remove autotools supportEric Engestrom2019-10-141-33/+0
| | | | | Signed-off-by: Eric Engestrom <eric.engestrom@intel.com> Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
* *-symbols-check: let meson figure out how to execute the scriptsEric Engestrom2019-10-041-2/+2
| | | | Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
* *-symbols-check: use normal shell over bashEmil Velikov2019-10-041-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>
* fix various typosEric Engestrom2019-04-172-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>
* freedreno: revert bad freedreno/atomic_ops commitsEric Engestrom2019-02-191-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>
* freedreno: remove always-defined #ifdefEric Engestrom2019-01-031-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>
* freedreno/msm: fix c90 warningRob Clark2018-10-141-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.
* freedreno/kgsl: fix buildRob Clark2018-10-141-0/+1
| | | | Signed-off-by: Rob Clark <robclark@freedesktop.org>
* freedreno/msm: handle ring-reloc to other stateobjsRob Clark2018-10-131-4/+29
| | | | Signed-off-by: Rob Clark <robclark@freedesktop.org>
* freedreno/msm: simplify msm_ringbuffer_flush()Rob Clark2018-10-131-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>
* freedreno/msm: use hashtable to track submit.cmds tableRob Clark2018-10-131-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>
* freedreno/msm: simplify emit_reloc_ring() vfuncRob Clark2018-10-134-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>
* freedreno/msm: remove reset of linked ringsRob Clark2018-10-132-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>
* freedreno: remove deprecated ringmarker APIRob Clark2018-10-134-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>
* freedreno/msm: support suballocation for stateobj rb'sRob Clark2018-10-134-18/+101
| | | | Signed-off-by: Rob Clark <robclark@freedesktop.org>
* freedreno: add flags param for rb creationRob Clark2018-10-134-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>
* freedreno: expose refcnt'ing on ringbuffersRob Clark2018-10-135-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>
* freedreno/msm: get rid of ring_bo unref hackRob Clark2018-10-131-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>
* *-symbols-check: error out when using unset variablesEmil Velikov2018-10-041-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>
* automake: set NM before running the testsEmil Velikov2018-10-041-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>
* freedreno: add missing drm_publicEric Engestrom2018-09-201-1/+1
| | | | | Fixes: 9a1470fb410bbc840459 "freedreno: annotate public functions" Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
* autotools: make symbols hidden by defaultLucas De Marchi2018-09-191-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>
* meson: make symbols hidden by defaultLucas De Marchi2018-09-191-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>
* freedreno: annotate public functionsLucas De Marchi2018-09-194-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>
* freedreno: move ring_cache behind fd_bo_del()Rob Clark2018-09-145-48/+45
| | | | | | So that it isn't bypassing normal refcnt'ing. Signed-off-by: Rob Clark <robclark@freedesktop.org>
* freedreno: fix spelling typoRob Clark2018-09-141-3/+3
| | | | Signed-off-by: Rob Clark <robclark@freedesktop.org>
* libdrm: add msm drm uapi headerTanmay Shah2018-08-232-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>
* freedreno: fix use-after-free with stateobj rb'sRob Clark2018-08-081-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>
* freedreno: don't leak stateobj rb refsRob Clark2018-08-081-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>
* freedreno/msm: "stateobj" supportRob Clark2018-07-302-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>
* freedreno: slight reorderingRob Clark2018-07-301-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>
* freedreno: small cleanupRob Clark2018-07-302-27/+31
| | | | | | Make cheezy growable array thing less open-coded before adding more. Signed-off-by: Rob Clark <robclark@freedesktop.org>
* freedreno: add fd_ringbuffer_new_object()Rob Clark2018-07-308-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>
* freedreno: add user ptr to fd_ringbufferRob Clark2018-06-181-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>
* freedreno: add fd_pipe refcountingRob Clark2018-05-094-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>
* meson,configure: include config.h automaticallyEric Engestrom2018-03-2014-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>
* meson: use pkg-config to detect libatomic_opsEric Engestrom2018-03-091-1/+1
| | | | | Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
* freedreno: add missing symbols to symbol-checkEric Engestrom2018-03-081-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>
* freedreno: add interface to get buffer addressRob Clark2018-02-264-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>
* *-symbol-check: Don't hard-code nm executableHeiko Becker2018-02-232-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>
* always define HAVE_VALGRINDEric Engestrom2018-01-291-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>
* always define HAVE_FREEDRENO_KGSLEric Engestrom2018-01-292-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>