aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'freedesktop/master' into aosp/masterJohn Stultz2018-04-1321-92/+310
|\ | | | | | | | | | | | | This merges the freedesktop/master branch into aosp/master Change-Id: I3104d45924f67d37808154d04c15518394204478 Signed-off-by: John Stultz <john.stultz@linaro.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>
| * freedreno: clamp priority based on # of ringsRob Clark2018-01-262-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>
| * meson: set proper pkg-config version for libdrm_freedrenoDylan Baker2018-01-251-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>
| * Add meson build systemDylan Baker2018-01-121-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>
| * freedreno: add the API fd_pipe_new2 to the symbol testEmil Velikov2017-11-071-0/+1
| | | | | | | | | | | | As kindly spotted by `make check' Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
| * freedreno: submit-queue context priorityRob Clark2017-11-048-7/+68
| | | | | | | | | | | | | | | | With a new-enough kernel to support prioritized submit-queues, we can expose priority level support to mesa. Open a submit queue associated with the fd_pipe and pass it's id back to SUBMIT ioctl. Signed-off-by: Rob Clark <robclark@freedesktop.org>
| * freedreno: sync uapi header (driver version 1.3.0)Rob Clark2017-11-041-6/+34
| | | | | | | | Signed-off-by: Rob Clark <robclark@freedesktop.org>
| * freedreno/kgsl: fix pointer-to-int castEric Engestrom2017-09-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Fixes this warning: freedreno/kgsl/kgsl_ringbuffer.c: In function ‘kgsl_ringbuffer_flush’: freedreno/kgsl/kgsl_ringbuffer.c:149:19: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] req.timestamp = (uint32_t)kgsl_ring->bo->hostptr; ^ Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com> Reviewed-by: Rob Clark <robdclark@gmail.com>
| * freedreno: prevent deadlock in error pathEric Engestrom2017-08-071-0/+1
| | | | | | | | | | Signed-off-by: Eric Engestrom <eric@engestrom.ch> Reviewed-by: Rob Clark <robdclark@gmail.com>
| * freedreno/msm: remove dead error pathEric Engestrom2017-08-071-6/+2
| | | | | | | | | | | | | | | | | | `ring` cannot be non-null, so the label reduces to a simple return. Then, there is no point initialising `ring` just to overwrite it before anyone reads it. Signed-off-by: Eric Engestrom <eric@engestrom.ch> Reviewed-by: Rob Clark <robdclark@gmail.com>
| * freedreno: remove dead error pathEric Engestrom2017-08-071-7/+3
| | | | | | | | | | | | | | | | | | `pipe` cannot be non-null, so the label reduces to a simple return. Then, there is no point initialising `pipe` just to overwrite it before anyone reads it. Signed-off-by: Eric Engestrom <eric@engestrom.ch> Reviewed-by: Rob Clark <robdclark@gmail.com>
| * freedreno: fix double-free on exitRob Clark2017-04-151-3/+3
| | | | | | | | | | Fixes: a07ae97 ("freedreno: fix device close issues") Signed-off-by: Rob Clark <robclark@freedesktop.org>
| * freedreno: fix device close issuesRob Clark2017-03-231-1/+2
| | | | | | | | | | | | | | Move closing the fd to after subclass ->destroy() (since it might want to delete gem bo's, etc), and actually free() the fd_device object. Signed-off-by: Rob Clark <robclark@freedesktop.org>
| * freedreno: valgrind supportRob Clark2017-03-236-2/+75
| | | | | | | | Signed-off-by: Rob Clark <robclark@freedesktop.org>
| * freedreno: fix potential use-after-free on a5xx+Rob Clark2017-03-211-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Something that valgrind spotted: ==8441== Invalid read of size 4 ==8441== at 0x5DEE168: msm_ringbuffer_emit_reloc (msm_ringbuffer.c:506) ==8441== by 0x5B48F0F: OUT_RELOCW (freedreno_util.h:241) ==8441== by 0x5B48F0F: fd5_emit_blit (fd5_emit.h:131) ==8441== by 0x5B48F0F: emit_gmem2mem_surf.isra.12 (fd5_gmem.c:450) ==8441== by 0x5B4910F: fd5_emit_tile_gmem2mem (fd5_gmem.c:477) ==8441== by 0x5B14943: render_tiles (freedreno_gmem.c:342) ==8441== by 0x5B14943: fd_gmem_render_tiles (freedreno_gmem.c:416) ==8441== by 0x5B0FBA7: batch_flush (freedreno_batch.c:281) ==8441== by 0x5B0FBA7: fd_batch_flush (freedreno_batch.c:306) ==8441== by 0x5B11FE7: fd_context_flush (freedreno_context.c:52) ==8441== by 0x58AD783: st_glFlush (st_cb_flush.c:121) ==8441== by 0x5751EE7: _mesa_make_current (context.c:1652) ==8441== by 0x58E6A97: st_api_make_current (st_manager.c:811) ==8441== by 0x5A2CE43: dri_unbind_context (dri_context.c:207) ==8441== by 0x5A2C77F: driUnbindContext (dri_util.c:589) ==8441== by 0x4AC8A67: MakeContextCurrent (glxcurrent.c:214) ==8441== Address 0x6f5eb1c is 204 bytes inside a block of size 240 free'd ==8441== at 0x4868F44: realloc (vg_replace_malloc.c:785) ==8441== by 0x5DEE143: msm_ringbuffer_emit_reloc (msm_ringbuffer.c:502) ==8441== by 0x5B48F0F: OUT_RELOCW (freedreno_util.h:241) ==8441== by 0x5B48F0F: fd5_emit_blit (fd5_emit.h:131) ==8441== by 0x5B48F0F: emit_gmem2mem_surf.isra.12 (fd5_gmem.c:450) ==8441== by 0x5B4910F: fd5_emit_tile_gmem2mem (fd5_gmem.c:477) ==8441== by 0x5B14943: render_tiles (freedreno_gmem.c:342) ==8441== by 0x5B14943: fd_gmem_render_tiles (freedreno_gmem.c:416) ==8441== by 0x5B0FBA7: batch_flush (freedreno_batch.c:281) ==8441== by 0x5B0FBA7: fd_batch_flush (freedreno_batch.c:306) ==8441== by 0x5B11FE7: fd_context_flush (freedreno_context.c:52) ==8441== by 0x58AD783: st_glFlush (st_cb_flush.c:121) ==8441== by 0x5751EE7: _mesa_make_current (context.c:1652) ==8441== by 0x58E6A97: st_api_make_current (st_manager.c:811) ==8441== by 0x5A2CE43: dri_unbind_context (dri_context.c:207) ==8441== by 0x5A2C77F: driUnbindContext (dri_util.c:589) ==8441== Block was alloc'd at ==8441== at 0x4868F44: realloc (vg_replace_malloc.c:785) ==8441== by 0x5DEE08B: msm_ringbuffer_emit_reloc (msm_ringbuffer.c:481) ==8441== by 0x5B48F0F: OUT_RELOCW (freedreno_util.h:241) ==8441== by 0x5B48F0F: fd5_emit_blit (fd5_emit.h:131) ==8441== by 0x5B48F0F: emit_gmem2mem_surf.isra.12 (fd5_gmem.c:450) ==8441== by 0x5B4909F: fd5_emit_tile_gmem2mem (fd5_gmem.c:465) ==8441== by 0x5B14943: render_tiles (freedreno_gmem.c:342) ==8441== by 0x5B14943: fd_gmem_render_tiles (freedreno_gmem.c:416) ==8441== by 0x5B0FBA7: batch_flush (freedreno_batch.c:281) ==8441== by 0x5B0FBA7: fd_batch_flush (freedreno_batch.c:306) ==8441== by 0x5B11FE7: fd_context_flush (freedreno_context.c:52) ==8441== by 0x58AD783: st_glFlush (st_cb_flush.c:121) ==8441== by 0x5751EE7: _mesa_make_current (context.c:1652) ==8441== by 0x58E6A97: st_api_make_current (st_manager.c:811) ==8441== by 0x5A2CE43: dri_unbind_context (dri_context.c:207) ==8441== by 0x5A2C77F: driUnbindContext (dri_util.c:589) Signed-off-by: Rob Clark <robclark@freedesktop.org>
* | Convert to Android.bpDan Willemsen2017-10-233-14/+27
| | | | | | | | | | | | | | | | | | | | | | | | See build/soong/README.md for more information about Soong. Removes BOARD_GPU_DRIVERS, which wasn't affecting anything, since none of the HAVE_* macros are defined. Even if they were, we'd prefer to compile all of them so that a single library can support multiple boards. Test: mmma external/libdrm Change-Id: Ie01736bce6cf41e3da5040fe5341ade0634b5111
* | Build libdrm* modules with BOARD_VNDK_VERSIONJiyong Park2017-10-191-1/+1
|/ | | | | | | | | | | | | | | | | They are marked as vendor module since they all are depending on libdrm, which is a vendor lib. Also, libdrm_platform is newly introduced as the platform version of libdrm. Bug: 37342627 Bug: 63741047 Test: BOARD_VNDK_VERSION=current m -j libdrm_amdgpu libdrm_etnaviv libdrm_freedreno libdrm_intel libdrm_nouveau libdrm_radeon libdrm_rockchip libdrm_tegra libkms modetest atomictest planetest Change-Id: Ic1ff6fb616f406f1c5e005d3e6f6039758d62315 Merged-In: Ic1ff6fb616f406f1c5e005d3e6f6039758d62315
* android: introduce Android.common.mk to reduce boilerplateEmil Velikov2017-01-271-5/+2
| | | | | | | | | | | | | | | | ... across the makefiles. Currently this isn't much but that will change shortly. As an added bonus this fixes all present and future cases where we've forgotten to strip out the headers from LOCAL_SRC_FILES. In a couple of cases (the tests) we start setting LOCAL_EXPORT_C_INCLUDE_DIRS, which shouldn't be an issue. Cc: Chih-Wei Huang <cwhuang@android-x86.org> Cc: Rob Herring <robh@kernel.org> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Rob Herring <robh@kernel.org>
* android: remove LOCAL_MODULE_TAGS := optional tagEmil Velikov2017-01-271-1/+0
| | | | | | | | | | | | Seems to be the default option since ~2009 with commit 2f31293ba78 "auto import from //branches/cupcake/...@137197". Fleshed out from a larger commit in the AOSP repo/fork. Cc: Dan Willemsen <dwillemsen@google.com> Cc: Chih-Wei Huang <cwhuang@android-x86.org> Cc: Rob Herring <robh@kernel.org> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Rob Herring <robh@kernel.org>
* freedreno: 64bit supportRob Clark2016-11-267-4/+49
| | | | | | | | a5xx and later are 64bit devices.. make reloc's handle that. A new public symbol is introduced to avoid silent problems with new mesa and old libdrm (since on 64b reloc consumes two dwords). Signed-off-by: Rob Clark <robclark@freedesktop.org>
* freedreno: Add fd_ringbuffer_flush2 to symbol check.Matt Turner2016-11-141-0/+1
|
* freedreno: add fence fd supportRob Clark2016-11-056-6/+36
| | | | Signed-off-by: Rob Clark <robclark@freedesktop.org>
* freedreno: sync uapi headerRob Clark2016-11-052-2/+22
| | | | Signed-off-by: Rob Clark <robclark@freedesktop.org>
* automake: Don't include Android Makefiles in the release tarballAndreas Boll2016-07-231-1/+1
| | | | | | | | | | | | | | Currently only some Android Makefiles are included in the release tarball. To be more consistent one could either add the remaining files or don't ship Android Makefiles altogether. According to Emil the Android folk doesn't use our release tarballs. Thus it makes sense to remove those files from distribution which also means less work for maintenance in the future. Suggested-by: Emil Velikov <emil.l.velikov@gmail.com> Signed-off-by: Andreas Boll <andreas.boll.dev@gmail.com> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
* freedreno: fix warningsRob Clark2016-07-211-2/+2
| | | | | Signed-off-by: Rob Clark <robclark@freedesktop.org> Tested-by: Rob Herring <robh@kernel.org>
* freedreno: fix android build breakRob Clark2016-07-211-2/+2
| | | | | | | | The 'deprecated' #define was causing problems with bionic system headers which used __attribute__((deprecated)). Signed-off-by: Rob Clark <robclark@freedesktop.org> Tested-by: Rob Herring <robh@kernel.org>
* freedreno: fix distcheck errorsRob Clark2016-07-211-0/+4
| | | | Signed-off-by: Rob Clark <robclark@freedesktop.org>
* freedreno: move legacy kgsl related READMERob Clark2016-07-201-0/+10
| | | | Signed-off-by: Rob Clark <robclark@freedesktop.org>
* freedreno/msm: use hashtable to track bo idxRob Clark2016-07-202-23/+31
| | | | | | | | Note: cache the last ring the bo was emitted on, to avoid excess hashtable lookups. We do this by tracking ring seqno to avoid problems with dangling pointers. Signed-off-by: Rob Clark <robclark@freedesktop.org>
* freedreno: support growable cmdstream buffersRob Clark2016-07-205-36/+166
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The issue that userspace needed to solve is that there is ~two orders of magnitude size difference in cmdstream buffers (both for gmem commands and for draw commands), and that the previous practice of allocating worst-case sizes is quite wasteful. Previously a submit would be constructed (for example) like: CMD TARGET DESCRIPTION g0 N gmem/tiling commands b0 Y binning commands d0 Y draw commands Which, after the one non-IB-target cmd buffer is inserted into the kernel controlled ringbuffer, looks like (not to scale): b0: d0: +-----+ +-----+ IB1 | ... | | ... | +-----+ +-----+ ^ ^ | | +-----+ +-+---------+ g0: | | | +----+----+----+----+----+----+---- IB0 | .. | IB | .. | IB | .. | IB | ... +----+----+----+----+----+----+---- ^ tile0 tile1 | +-----------+ userspace | ~~~~~~~~~~~~~~~~~~~|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ kernel | ----+----+---- ringbuffer ... | IB | ... ----+----+---- Now, multiple physical cmdstream buffers per fd_ringbuffer are supported, so this becomes: CMD TARGET DESCRIPTION g0 N ... N gmem/tiling commands gN N b0 Y ... Y binning commands bN Y d0 Y ... Y draw commands dN Y Which, after the non-IB-target cmd buffers (g0..gN) are inserted into the kernel controlled ringbuffer, looks like: b0: b1 d0: d1 +-----+ +-----+ +-----+ +-----+ IB1 | ... | | ... | ... | ... | | ... | ... +-----+ +-----+ +-----+ +-----+ ^ ^ ^ ^ | | | | | +-+ | +-----+------+ +-----+ | | | | | | +--+----------+ | g0: | | | | | | +----+----+----+----+----+----+---+----+----+---- IB0 | .. | IB | IB | .. | IB | IB |.. | IB | IB |... +----+----+----+----+----+----+---+----+----+---- ^ tile0 tile1 | to b0 to b1 | | | to|d0 to|d1 | | +----+ | +-+-----------+ | | | | | | | +------+ | +-+-------------+ | | g1: | | | | | | | +----+----+----+----+----+----+---+----+----+---- IB0 | | .. | IB | IB | .. | IB | IB |.. | IB | IB |... | +----+----+----+----+----+----+---+----+----+---- | ^ tileX tileY | | | +-----------+ +-----------+ | userspace | | ~~~~~~~~~~~~~~~~~~~|~~~~|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ kernel | | ----+----+----+---- ringbuffer ... | IB | IB | ... ----+----+----+---- Signed-off-by: Rob Clark <robclark@freedesktop.org>
* freedreno/msm: split out dump_submit() helperRob Clark2016-07-201-18/+24
| | | | Signed-off-by: Rob Clark <robclark@freedesktop.org>
* freedreno/msm: split out cmd buffer tracking from ringRob Clark2016-07-201-45/+83
| | | | | | | | First step towards supporting a single logical ringbuffer mapping to multiple physical cmd buffers, which will enable dynamically growing ringbuffers. Signed-off-by: Rob Clark <robclark@freedesktop.org>
* freedreno/msm: drop return from get_cmd()Rob Clark2016-07-201-20/+16
| | | | | | | Not actually needed. It just needs to ensure that there is a corresponding entry in the submit's cmds table. Signed-off-by: Rob Clark <robclark@freedesktop.org>
* freedreno/msm: use private bo-cache for ringbuffer bo'sRob Clark2016-07-203-2/+39
| | | | | | | Since they get vmap'd on the kernel side, they are a bit more costly. Don't let them mingle with the riffraff. Signed-off-by: Rob Clark <robclark@freedesktop.org>
* freedreno: fix potential leak at freeRob Clark2016-07-202-6/+7
| | | | | | | If user has emit'd reloc's, and then resets or deletes the ring, we want to drop the ref's that the ring holds to the bo's to avoid a leak. Signed-off-by: Rob Clark <robclark@freedesktop.org>
* freedreno: ocdRob Clark2016-07-202-7/+5
| | | | Signed-off-by: Rob Clark <robclark@freedesktop.org>
* freedreno: support either coarse or fine-grained bucket sizesRob Clark2016-07-203-7/+14
| | | | | | | | The normal bo cache uses some intermediate steps between power of two jumps to reduce memory wastage. But for a ringbuffer bo cache, we do not need this. Signed-off-by: Rob Clark <robclark@freedesktop.org>
* freedreno: expose kernel driver versionRob Clark2016-07-204-2/+12
| | | | | | | gallium needs to know if the kernel is new enough to support explicit fencing, dynamically grown ringbuffers, etc. Signed-off-by: Rob Clark <robclark@freedesktop.org>
* freedreno: fix potential fd leak in error pathRob Clark2016-07-201-1/+4
| | | | Signed-off-by: Rob Clark <robclark@freedesktop.org>
* freedreno: add madvise supportRob Clark2016-07-205-0/+55
| | | | | | | With a new enough drm/msm, we can let the kernel know about buffers that are in the bo cache, so the kernel can free them under memory pressure. Signed-off-by: Rob Clark <robclark@freedesktop.org>
* freedreno: sync uapiRob Clark2016-07-201-39/+70
| | | | | | (from drm-next for 4.8) Signed-off-by: Rob Clark <robclark@freedesktop.org>
* freedreno: move bo-cache to it's own fileRob Clark2016-07-204-178/+209
| | | | Signed-off-by: Rob Clark <robclark@freedesktop.org>
* freedreno: refactor bo-cache APIRob Clark2016-07-203-33/+58
| | | | | | | Split out interface to allocate from and release to bo-cache, and get rid of direct usage of bucket level API from fd_bo/etc. Signed-off-by: Rob Clark <robclark@freedesktop.org>