summaryrefslogtreecommitdiff
path: root/etnaviv
AgeCommit message (Collapse)AuthorFilesLines
2018-05-02etnaviv: Avoid dereferencing type-punned pointerThierry Reding1-2/+3
Use proper types directly rather than casts to avoid warnings from GCC about potentially breaking strict-aliasing rules: etnaviv/etnaviv_bo.c: In function 'lookup_bo': etnaviv/etnaviv_bo.c:71:2: warning: dereferencing type-punned pointer might break strict-aliasing rules [-Wstrict-aliasing] if (!drmHashLookup(tbl, handle, (void **)&bo)) { ^~ Signed-off-by: Thierry Reding <treding@nvidia.com>
2018-03-30headers: Sync with drm-nextDaniel Stone1-0/+7
Taken from the drm-next pull for 4.17-rc1 (694f54f680f7), and manually reconciled: core: - Dropped DRM_MODE_TYPE_ALL and DRM_MODE_FLAG_ALL; these are purely internal details of the bits accepted by the currently running kernel, and can not be generally relied on by userspace - Add HDCP flags - Note CTM entry representation is sign-magnitude format, not two's-complement amdgpu: - Add QUERY_STATE2 context op - Add VCN firmware version query etnaviv: - Add more GPU feature flags i915: - Add caps, params and ioctls for PMU / perf-stream - Add support for explicit fencing nouveau: - Add TILE_COMP layout vc4: - Add perfmon ioctls virtgpu: - Add capset-fix param vmware: - Add handle-close ioctl and explicit-fencing support Signed-off-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2018-03-20meson,configure: include config.h automaticallyEric Engestrom7-28/+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-01-12Add meson build systemDylan Baker1-0/+59
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>
2017-12-15etnaviv: fix BO cache to properly work with different flagsLucas Stach1-7/+19
Currently if the oldest BO in a bucket has different flags than what we look for we'll miss the cache.Fix this by iterating over the cached BOs until we find the oldest one with matching flags. This improves the hit ratio for some of the buckets. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de> Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
2017-12-15etnaviv: support performance monitor requestsChristian Gmeiner4-0/+37
Add etna_cmd_stream_perf(..) to submit perform requests. Userspace can submit pmrs via submit ioctl to sample perfmon signals. v3: - mark perfmon bos as RW Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com> Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
2017-12-15etnaviv: add permon supportChristian Gmeiner5-0/+226
Query all domains and their signals and provide it this information via struct etna_perfmon and the corresponding api functions. v2: - code style changes - etna_perfmon_create(..): add missing clean up in error case Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com> Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
2017-12-15etnaviv: sync uapi headerChristian Gmeiner1-1/+42
Import the etnaviv header changes from kernel commit 05916bed1 (drm-next) The drm_etnaviv_gem_submit structure was extended to include performance monitor requests. Also two new ioctls got added to be able to readout performance monitor domains and their signals. Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com> Acked-by: Lucas Stach <l.stach@pengutronix.de>
2017-09-14etnaviv: prevent deadlock in error pathPhilipp Zabel1-0/+5
If drmPrimeFDToHandle fails in etna_bo_from_dmabuf, the function must not return with the table_lock mutex held. Unlock the mutex in the error path. Based on ceb70a6b1015 ("freedreno: prevent deadlock in error path"). Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2017-08-21etnaviv: fix etna_bo_from_namePhilipp Zabel1-1/+1
Look up BOs from the name table using the name parameter instead of req.handle (which at this point is always zero). Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Reviewed-by: Eric Engestrom <eric@engestrom.ch> Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com> Reviewed-by: Wladimir J. van der Laan <laanwj@gmail.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
2017-07-06etnaviv: submit full struct drm_etnaviv_gem_submitChristian Gmeiner1-7/+1
It is safe to submit the full struct even on older kernels as such kernels do not process the full struct. Without this change it becomes quite challenging to extned the submit struct. Freedreno has no special treatment too. See git commits - freedreno: sync uapi header - freedreno: add fence fd support Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de> Tested-by: Philipp Zabel <p.zabel@pengutronix.de>
2017-04-12etnaviv: add fence fd supportPhilipp Zabel3-4/+32
Add etna_cmd_stream_flush2 with in-fence fd and out-fence fd support for explicit fencing. v3: added etna_cmd_stream_flush2 to etnaviv/etnaviv-symbol-check v2: renamed etna_cmd_stream_flush_explicit to etna_cmd_stream_flush2 Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
2017-04-12etnaviv: sync uapi headerPhilipp Zabel1-0/+8
Import the etnaviv header changes from kernel commits 9ad59fea162c ("drm/etnaviv: submit support for in-fences") and 78ec187f64fa ("drm/etnaviv: submit support for out-fences") for fence fd support. The drm_etnaviv_gem_submit structure was extended to include a flags field, new flags for in-fence and out-fence fds and an input/output fence fd field. This is one-way backwards compatible because old userspace code passing a short structure not including the flags field to new kernels will cause the remaining fields to be zero-filled. New userspace code must make sure to only pass the short structure to old kernels, though. Not generated using make headers_install, since the drm/etnaviv_drm.h uapi header is not installed yet by the kernel. Copied from the airlied/drm-next commit 78ec187f64fa. v2: improved commit message Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
2017-04-01etnaviv: remove struct etna_specsChristian Gmeiner2-64/+30
There is no need to cache spec values directly as library users will cache them anyway. Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
2017-01-27android: introduce Android.common.mk to reduce boilerplateEmil Velikov1-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>
2017-01-27android: remove LOCAL_MODULE_TAGS := optional tagEmil Velikov1-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>
2016-11-24etnaviv: add etna_pipe_wait_ns(..)Christian Gmeiner3-2/+9
We need to pass through a timeout parameter to implement pipe->fence_finish() properly. The new fxn accepts a timeout in nanoseconds. Simplify etna_pipe_wait(..) by using etna_pipe_wait_ns(..). Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2016-11-24etnaviv: change get_abs_timeout(..) to use ns.Christian Gmeiner3-5/+5
Also update all callers. Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2016-11-20etnaviv: add API to create etna_device from private dup() fdChristian Gmeiner4-0/+22
Like etna_device_new() but creates it's own private dup() of the fd which is close()d when the device is finalized. Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com> Acked-by: Eric Anholt <eric@anholt.net>
2016-11-20etnaviv: add API to get drm fd from etna_deviceChristian Gmeiner3-0/+7
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com> Acked-by: Eric Anholt <eric@anholt.net>
2016-09-17libdrm: add etnaviv drm supportThe etnaviv authors14-0/+1867
Add the libdrm_etnaviv helper library to encapsulate etnaviv-specific interfaces to the DRM. Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com> Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Tested-by: Rob Herring <robh@kernel.org>