Makefile.am | 1 Makefile.sources | 1 amdgpu/Makefile.sources | 1 amdgpu/amdgpu-symbol-check | 1 amdgpu/amdgpu.h | 10 amdgpu/amdgpu_asic_id.h | 165 +++++ amdgpu/amdgpu_device.c | 15 amdgpu/amdgpu_gpu_info.c | 2 configure.ac | 2 debian/changelog | 15 debian/control | 2 debian/copyright | 2 debian/libdrm-amdgpu1.symbols | 1 debian/libdrm-freedreno1.symbols | 1 debian/libdrm-intel1.symbols | 3 debian/libdrm2.symbols | 1 debian/rules | 8 freedreno/freedreno-symbol-check | 1 freedreno/freedreno_drmif.h | 1 freedreno/freedreno_priv.h | 3 freedreno/freedreno_ringbuffer.c | 11 freedreno/freedreno_ringbuffer.h | 5 freedreno/kgsl/kgsl_ringbuffer.c | 6 freedreno/msm/msm_drm.h | 22 freedreno/msm/msm_ringbuffer.c | 18 include/drm/README | 157 +++++ include/drm/drm.h | 17 include/drm/drm_mode.h | 49 + intel/Makefile.sources | 3 intel/intel-symbol-check | 3 intel/intel_bufmgr.h | 4 intel/intel_bufmgr_gem.c | 392 ++++++++++---- intel/uthash.h | 1074 +++++++++++++++++++++++++++++++++++++++ libsync.h | 148 +++++ xf86drm.c | 8 xf86drmMode.c | 16 xf86drmMode.h | 3 37 files changed, 2047 insertions(+), 125 deletions(-)
New commits: commit 30a5b54fcf43863f42d9abc6d55ce2a3c0d855f1 Author: Andreas Boll <andreas.boll....@gmail.com> Date: Tue Nov 29 16:37:21 2016 +0100 Rebuild for jessie-backports. diff --git a/debian/changelog b/debian/changelog index 6dcc10a..0c0c2f2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +libdrm (2.4.73-1~bpo8+1) jessie-backports; urgency=medium + + * Rebuild for jessie-backports. + + -- Andreas Boll <andreas.boll....@gmail.com> Tue, 29 Nov 2016 16:37:00 +0100 + libdrm (2.4.73-1) unstable; urgency=medium * New upstream release. commit cd11bac06d51efc4a1e1ab0c6882575774d7a8cd Author: Andreas Boll <andreas.boll....@gmail.com> Date: Tue Nov 15 15:43:26 2016 +0100 Upload to unstable. diff --git a/debian/changelog b/debian/changelog index 857673a..afe749c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,11 +1,11 @@ -libdrm (2.4.73-1) UNRELEASED; urgency=medium +libdrm (2.4.73-1) unstable; urgency=medium * New upstream release. * Bump libdrm2's, libdrm-amdgpu1's, libdrm-freedreno1's and libdrm- intel1's symbols and shlibs. * Update a bunch of URLs in packaging to https. - -- Andreas Boll <andreas.boll....@gmail.com> Thu, 03 Nov 2016 12:13:24 +0100 + -- Andreas Boll <andreas.boll....@gmail.com> Tue, 15 Nov 2016 15:43:02 +0100 libdrm (2.4.71-1) unstable; urgency=medium commit 35354731e531e390ed2167c89ce4abdd56bab89f Author: Andreas Boll <andreas.boll....@gmail.com> Date: Tue Nov 15 15:29:18 2016 +0100 Bump libdrm2's, libdrm-amdgpu1's, libdrm-freedreno1's and libdrm-intel1's symbols and shlibs. diff --git a/debian/changelog b/debian/changelog index 5b0a495..857673a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,8 @@ libdrm (2.4.73-1) UNRELEASED; urgency=medium * New upstream release. + * Bump libdrm2's, libdrm-amdgpu1's, libdrm-freedreno1's and libdrm- + intel1's symbols and shlibs. * Update a bunch of URLs in packaging to https. -- Andreas Boll <andreas.boll....@gmail.com> Thu, 03 Nov 2016 12:13:24 +0100 diff --git a/debian/libdrm-amdgpu1.symbols b/debian/libdrm-amdgpu1.symbols index a1014f4..b4e4d68 100644 --- a/debian/libdrm-amdgpu1.symbols +++ b/debian/libdrm-amdgpu1.symbols @@ -24,6 +24,7 @@ libdrm_amdgpu.so.1 libdrm-amdgpu1 #MINVER# amdgpu_cs_wait_semaphore@Base 2.4.67 amdgpu_device_deinitialize@Base 2.4.63 amdgpu_device_initialize@Base 2.4.63 + amdgpu_get_marketing_name@Base 2.4.73 amdgpu_query_buffer_size_alignment@Base 2.4.63 amdgpu_query_crtc_from_id@Base 2.4.63 amdgpu_query_firmware_version@Base 2.4.63 diff --git a/debian/libdrm-freedreno1.symbols b/debian/libdrm-freedreno1.symbols index b686576..70b84cd 100644 --- a/debian/libdrm-freedreno1.symbols +++ b/debian/libdrm-freedreno1.symbols @@ -28,6 +28,7 @@ libdrm_freedreno.so.1 libdrm-freedreno1 #MINVER# fd_ringbuffer_del@Base 0 fd_ringbuffer_emit_reloc_ring@Base 0 fd_ringbuffer_emit_reloc_ring_full@Base 2.4.70 + fd_ringbuffer_flush2@Base 2.4.73 fd_ringbuffer_flush@Base 0 fd_ringbuffer_grow@Base 2.4.70 fd_ringbuffer_new@Base 0 diff --git a/debian/libdrm-intel1.symbols b/debian/libdrm-intel1.symbols index cf08516..102f799 100644 --- a/debian/libdrm-intel1.symbols +++ b/debian/libdrm-intel1.symbols @@ -59,6 +59,9 @@ libdrm_intel.so.1 libdrm-intel1 #MINVER# drm_intel_gem_bo_clear_relocs@Base 2.4.27 drm_intel_gem_bo_context_exec@Base 2.4.36 drm_intel_gem_bo_get_reloc_count@Base 2.4.27 + drm_intel_gem_bo_map__cpu@Base 2.4.73 + drm_intel_gem_bo_map__gtt@Base 2.4.73 + drm_intel_gem_bo_map__wc@Base 2.4.73 drm_intel_gem_bo_map_gtt@Base 2.4.3 drm_intel_gem_bo_map_unsynchronized@Base 2.4.32 drm_intel_gem_bo_start_gtt_access@Base 2.4.3 diff --git a/debian/libdrm2.symbols b/debian/libdrm2.symbols index 60899af..1a57179 100644 --- a/debian/libdrm2.symbols +++ b/debian/libdrm2.symbols @@ -126,6 +126,7 @@ libdrm.so.2 libdrm2 #MINVER# drmModeObjectGetProperties@Base 2.4.36 drmModeObjectSetProperty@Base 2.4.36 drmModePageFlip@Base 2.4.17 + drmModePageFlipTarget@Base 2.4.73 drmModeRmFB@Base 2.4.3 drmModeSetCrtc@Base 2.4.3 drmModeSetCursor2@Base 2.4.46 diff --git a/debian/rules b/debian/rules index d0c6eb0..2a7b70b 100755 --- a/debian/rules +++ b/debian/rules @@ -114,15 +114,15 @@ endif dh_strip -s --remaining-packages override_dh_makeshlibs: - dh_makeshlibs -plibdrm2 -V'libdrm2 (>= 2.4.71)' --add-udeb=libdrm2-udeb -- -c4 + dh_makeshlibs -plibdrm2 -V'libdrm2 (>= 2.4.73)' --add-udeb=libdrm2-udeb -- -c4 ifeq ($(INTEL), yes) - dh_makeshlibs -plibdrm-intel1 -V'libdrm-intel1 (>= 2.4.71)' -- -c4 + dh_makeshlibs -plibdrm-intel1 -V'libdrm-intel1 (>= 2.4.73)' -- -c4 endif ifeq ($(NOUVEAU), yes) dh_makeshlibs -plibdrm-nouveau2 -V'libdrm-nouveau2 (>= 2.4.66)' -- -c4 endif dh_makeshlibs -plibdrm-radeon1 -V'libdrm-radeon1 (>= 2.4.39)' -- -c4 - dh_makeshlibs -plibdrm-amdgpu1 -V'libdrm-amdgpu1 (>= 2.4.63)' -- -c4 + dh_makeshlibs -plibdrm-amdgpu1 -V'libdrm-amdgpu1 (>= 2.4.73)' -- -c4 ifeq ($(ARM), yes) dh_makeshlibs -plibdrm-omap1 -V'libdrm-omap1 (>= 2.4.38)' -- -c4 dh_makeshlibs -plibdrm-exynos1 -V'libdrm-exynos1 (>= 2.4.66)' -- -c4 @@ -131,7 +131,7 @@ ifeq ($(TEGRA), yes) dh_makeshlibs -plibdrm-tegra0 -V'libdrm-tegra0' -- -c4 endif ifeq ($(FREEDRENO), yes) - dh_makeshlibs -plibdrm-freedreno1 -V'libdrm-freedreno1 (>= 2.4.70)' -- -c4 + dh_makeshlibs -plibdrm-freedreno1 -V'libdrm-freedreno1 (>= 2.4.73)' -- -c4 endif %: commit 810fefb2633dcbf7a01094af83df0d3fa8e76eb8 Author: Andreas Boll <andreas.boll....@gmail.com> Date: Tue Nov 15 14:31:29 2016 +0100 Bump changelog diff --git a/debian/changelog b/debian/changelog index 6b0520f..5b0a495 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,6 @@ -libdrm (2.4.71-2) UNRELEASED; urgency=medium +libdrm (2.4.73-1) UNRELEASED; urgency=medium + * New upstream release. * Update a bunch of URLs in packaging to https. -- Andreas Boll <andreas.boll....@gmail.com> Thu, 03 Nov 2016 12:13:24 +0100 commit 317bdff14ac8f1e8735f97d96c7eb963e1e47a4a Author: Emil Velikov <emil.l.veli...@gmail.com> Date: Mon Nov 14 19:48:38 2016 +0000 Bump version for release diff --git a/configure.ac b/configure.ac index 1c7a7fb..9f25a4c 100644 --- a/configure.ac +++ b/configure.ac @@ -20,7 +20,7 @@ AC_PREREQ([2.63]) AC_INIT([libdrm], - [2.4.72], + [2.4.73], [https://bugs.freedesktop.org/enter_bug.cgi?product=DRI], [libdrm]) commit f53d3542c1dfa2a1c1a5a7155d058df9a6bcce7b Author: Emil Velikov <emil.veli...@collabora.com> Date: Fri Nov 11 19:04:11 2016 +0000 xd86drm: read more than 128 bytes of uevent in drmParsePciBusInfo Some platforms (such as Macs using OF) can have more information in the uevent file thus reading only the first 128 might not be sufficient. Bump it to 512, which "should be enough for everybody" ;-) v2: Use sizeof(data)-1 over hardcoded number (Eric). Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98629 Signed-off-by: Emil Velikov <emil.veli...@collabora.com> Reported-by: Mingcong Bai <jeff...@aosc.xyz> Tested-by: Mingcong Bai <jeff...@aosc.xyz> (v1) Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com> diff --git a/xf86drm.c b/xf86drm.c index 52add5e..9b97bbb 100644 --- a/xf86drm.c +++ b/xf86drm.c @@ -2864,7 +2864,7 @@ static int drmParsePciBusInfo(int maj, int min, drmPciBusInfoPtr info) { #ifdef __linux__ char path[PATH_MAX + 1]; - char data[128 + 1]; + char data[512 + 1]; char *str; int domain, bus, dev, func; int fd, ret; @@ -2875,7 +2875,7 @@ static int drmParsePciBusInfo(int maj, int min, drmPciBusInfoPtr info) return -errno; ret = read(fd, data, sizeof(data)); - data[128] = '\0'; + data[sizeof(data)-1] = '\0'; close(fd); if (ret < 0) return -errno; commit de13ea387737cdc99ec43813acb4d4f443075db2 Author: Emil Velikov <emil.l.veli...@gmail.com> Date: Mon Nov 14 17:59:28 2016 +0000 headers: Add README file Since we're trying to standardise and make things more consistent in the area, add a basic README which covers some of the more popular topics. v2: - Drop drm-misc (Daniel Vetter) v3: - Elaborate on when and which headers to update - Add a list of headers and the respective "issues" - Add file to EXTRA_DIST Cc: Dave Airlie <airl...@redhat.com> Reviewed-by: Daniel Vetter <daniel.vet...@ffwll.ch> (v1) Signed-off-by: Emil Velikov <emil.l.veli...@gmail.com> diff --git a/Makefile.am b/Makefile.am index 630edc4..2e46bde 100644 --- a/Makefile.am +++ b/Makefile.am @@ -133,6 +133,7 @@ if HAVE_VMWGFX klibdrminclude_HEADERS += $(LIBDRM_INCLUDE_VMWGFX_H_FILES) endif +EXTRA_DIST = include/drm/README copy-headers : cp -r $(kernel_source)/include/uapi/drm/*.h $(top_srcdir)/include/drm/ diff --git a/include/drm/README b/include/drm/README new file mode 100644 index 0000000..c3292f3 --- /dev/null +++ b/include/drm/README @@ -0,0 +1,157 @@ +What are these headers ? +------------------------ +This is the canonical source of drm headers that user space should use for +communicating with the kernel DRM subsystem. + +They flow from the kernel, thus any changes must be merged there first. +Do _not_ attempt to "fix" these by deviating from the kernel ones ! + + +Non-linux platforms - changes/patches +------------------------------------- +If your platform has local changes, please send them upstream for inclusion. +Even if your patches don't get accepted in their current form, devs will +give you feedback on how to address things properly. + +git send-email --subject-prefix="PATCH libdrm" your patches to dri-devel +mailing list. + +Before doing so, please consider the following: + - Have the [libdrm vs kernel] headers on your platform deviated ? +Consider unifying them first. + + - Have you introduced additional ABI that's not available in Linux ? +Propose it for [Linux kernel] upstream inclusion. +If that doesn't work out (hopefully it never does), move it to another header +and/or keep the change(s) local ? + + - Are your changes DRI1/UMS specific ? +There is virtually no interest/power in keeping those legacy interfaces. They +are around due to the kernel "thou shalt not break existing user space" rule. + +Consider porting the driver to DRI2/KMS - all (almost?) sensible hardware is +capable of supporting those. + + +Which headers go where ? +------------------------ +A snipped from the, now removed, Makefile.am used to state: + + XXX airlied says, nothing besides *_drm.h and drm*.h should be necessary. + however, r300 and via need their reg headers installed in order to build. + better solutions are welcome. + +Obviously the r300 and via headers are no longer around ;-) + +Reason behind is that the drm headers can be used as a basic communications +channel with the respective kernel modules. If more advanced functionality is +required one can pull the specific libdrm_$driver which is free to pull +additional files from the kernel. + +For example: nouveau has nouveau/nvif/*.h while vc4 has vc4/*.h + +If your driver is still in prototyping/staging state, consider moving the +$driver_drm.h into $driver and _not_ installing it. An header providing opaque +definitions and access [via $driver_drmif.h or similar] would be better fit. + + +When and which headers to update +-------------------------------- +Ideally all files will be synced (updated) with the latest released kernel on +each libdrm release. Sadly that's not yet possible since quite a few headers +differ significantly - see Outdated or Broken Headers section below. + +That said, it's up-to the individual developers to sync with newer version +(from drm-next) as they see fit. + + +When and how to update these files +---------------------------------- +In order to update the files do the following: + - Switch to a Linux kernel tree/branch which is not rebased. +For example: airlied/drm-next + - Install the headers via `make headers_install' to a separate location. + - Copy the drm header[s] + git add + git commit. + - Note: Your commit message must include: + a) Brief summary on the delta. If there's any change that looks like an +API/ABI break one _must_ explicitly state why it's safe to do so. + b) "Generated using make headers_install." + c) "Generated from $tree/branch commit $sha" + + +Outdated or Broken Headers +-------------------------- +This section contains a list of headers and the respective "issues" they might +have relative to their kernel equivalent. + +Nearly all headers: + - Missing extern C notation. +Status: Trivial. + +Most UMS headers: + - Not using fixed size interers - compat ioctls are broken. +Status: ? +Promote to fixed size ints, which match the current (32bit) ones. + + +amdgpu_drm.h + - Using the stdint.h uint*_t over the respective __u* ones +Status: Trivial. + +drm_mode.h + - Missing DPI encode/connector pair. +Status: Trivial. + +i915_drm.h + - Missing PARAMS - HAS_POOLED_EU, MIN_EU_IN_POOL CONTEXT_PARAM_NO_ERROR_CAPTURE +Status: Trivial. + +mga_drm.h + - Typo fix, use struct over typedef. +Status: Trivial. + +nouveau_drm.h + - Missing macros NOUVEAU_GETPARAM*, NOUVEAU_DRM_HEADER_PATCHLEVEL, structs, +enums, using stdint.h over the __u* types. +Status: ? + +qxl_drm.h + - Using the stdint.h uint*_t over the respective __u* ones +Status: Trivial. + +r128_drm.h + - Broken compat ioctls. + +radeon_drm.h + - Missing RADEON_TILING_R600_NO_SCANOUT, CIK_TILE_MODE_*, broken UMS ioctls, +using stdint types. + - Both kernel and libdrm: missing padding - +drm_radeon_gem_{create,{g,s}et_tiling,set_domain} others ? +Status: ? + +savage_drm.h + - Renamed ioctls - DRM_IOCTL_SAVAGE_{,BCI}_EVENT_EMIT, compat ioctls are broken. +Status: ? + +sis_drm.h + - Borken ioctls + libdrm uses int vs kernel long +Status: ? + +via_drm.h + - Borken ioctls - libdrm int vs kernel long +Status: ? + + +omap_drm.h (living in $TOP/omap) + - License mismatch, missing DRM_IOCTL_OMAP_GEM_NEW and related struct +Status: ? + +msm_drm.h (located in $TOP/freedreno/msm/) + - License mismatch, missing MSM_PIPE_*, MSM_SUBMIT_*. Renamed +drm_msm_gem_submit::flags, missing drm_msm_gem_submit::fence_fd. +Status: ? + +exynos_drm.h (living in $TOP/exynos) + - License mismatch, now using fixed size ints (but not everywhere). Lots of +new stuff. +Status: ? commit 8cf431271a8ad33c35859da2fb0387e6bccecd44 Author: Matt Turner <matts...@gmail.com> Date: Mon Nov 14 10:34:47 2016 -0800 Bump version for release diff --git a/configure.ac b/configure.ac index ac6b106..1c7a7fb 100644 --- a/configure.ac +++ b/configure.ac @@ -20,7 +20,7 @@ AC_PREREQ([2.63]) AC_INIT([libdrm], - [2.4.71], + [2.4.72], [https://bugs.freedesktop.org/enter_bug.cgi?product=DRI], [libdrm]) commit b91bcbf6ab76c84a348b3e0bec0ee212e94a432a Author: Matt Turner <matts...@gmail.com> Date: Mon Nov 14 10:23:17 2016 -0800 freedreno: Add fd_ringbuffer_flush2 to symbol check. diff --git a/freedreno/freedreno-symbol-check b/freedreno/freedreno-symbol-check index 7b31a34..ad367fc 100755 --- a/freedreno/freedreno-symbol-check +++ b/freedreno/freedreno-symbol-check @@ -49,6 +49,7 @@ fd_ringbuffer_timestamp fd_ringmarker_del fd_ringmarker_dwords fd_ringmarker_flush +fd_ringbuffer_flush2 fd_ringmarker_mark fd_ringmarker_new EOF commit 01db192f974ead239c7122c04ef83e2cc9a8db50 Author: Matt Turner <matts...@gmail.com> Date: Mon Nov 14 10:16:27 2016 -0800 amdgpu: Add amdgpu_asic_id.h to Makefile.sources. diff --git a/amdgpu/Makefile.sources b/amdgpu/Makefile.sources index 0c0b9a9..487b9e0 100644 --- a/amdgpu/Makefile.sources +++ b/amdgpu/Makefile.sources @@ -1,4 +1,5 @@ LIBDRM_AMDGPU_FILES := \ + amdgpu_asic_id.h \ amdgpu_bo.c \ amdgpu_cs.c \ amdgpu_device.c \ commit 51002c0440b0e410efa3845f2633826aad7f3aa3 Author: Matt Turner <matts...@gmail.com> Date: Mon Nov 14 10:13:22 2016 -0800 intel: Add uthash.h to Makefile.sources. diff --git a/intel/Makefile.sources b/intel/Makefile.sources index 7b2272c..6947ab7 100644 --- a/intel/Makefile.sources +++ b/intel/Makefile.sources @@ -6,7 +6,8 @@ LIBDRM_INTEL_FILES := \ intel_decode.c \ intel_chipset.h \ mm.c \ - mm.h + mm.h \ + uthash.h LIBDRM_INTEL_H_FILES := \ intel_bufmgr.h \ commit 319108f9475f0165c9b4885efc8cf3b7e042b7fb Author: Neil Roberts <n...@linux.intel.com> Date: Mon Nov 9 16:27:52 2015 +0100 intel: Allow some codenames in INTEL_DEVID_OVERRIDE As well as allowing a hexadecimal PCI ID number, the INTEL_DEVID_OVERRIDE environment variable can now contain one of a few short codenames. The codenames are stored in a small table to map them to a corresponding PCI ID. This makes it easier to use without having to look up the PCI IDs manually. The PCI IDs used are the same as those chosen for the -p option of run.c in shader-db but SKL has been added as well. Reviewed-by: Matt Turner <matts...@gmail.com> diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c index 1792796..15c79b3 100644 --- a/intel/intel_bufmgr_gem.c +++ b/intel/intel_bufmgr_gem.c @@ -3060,6 +3060,34 @@ drm_intel_bufmgr_gem_set_vma_cache_size(drm_intel_bufmgr *bufmgr, int limit) drm_intel_gem_bo_purge_vma_cache(bufmgr_gem); } +static int +parse_devid_override(const char *devid_override) +{ + static const struct { + const char *name; + int pci_id; + } name_map[] = { + { "brw", PCI_CHIP_I965_GM }, + { "g4x", PCI_CHIP_GM45_GM }, + { "ilk", PCI_CHIP_ILD_G }, + { "snb", PCI_CHIP_SANDYBRIDGE_M_GT2_PLUS }, + { "ivb", PCI_CHIP_IVYBRIDGE_S_GT2 }, + { "hsw", PCI_CHIP_HASWELL_CRW_E_GT3 }, + { "byt", PCI_CHIP_VALLEYVIEW_3 }, + { "bdw", 0x1620 | BDW_ULX }, + { "skl", PCI_CHIP_SKYLAKE_DT_GT2 }, + { "kbl", PCI_CHIP_KABYLAKE_DT_GT2 }, + }; + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(name_map); i++) { + if (!strcmp(name_map[i].name, devid_override)) + return name_map[i].pci_id; + } + + return strtod(devid_override, NULL); +} + /** * Get the PCI ID for the device. This can be overridden by setting the * INTEL_DEVID_OVERRIDE environment variable to the desired ID. @@ -3076,7 +3104,7 @@ get_pci_device_id(drm_intel_bufmgr_gem *bufmgr_gem) devid_override = getenv("INTEL_DEVID_OVERRIDE"); if (devid_override) { bufmgr_gem->no_exec = true; - return strtod(devid_override, NULL); + return parse_devid_override(devid_override); } } commit 670f1e4fdadc197599cdc61d3104f8c27234765e Author: Junwei Zhang <jerry.zh...@amd.com> Date: Mon Sep 12 11:14:11 2016 -0400 amdgpu: add the function to get the marketing name (v4) This function is used to look up the marking name for a specific board. v2: agd: Squash in subsequent updates to the table. v3: [Michel Dänzer] * Make amdgpu_asic_id_table static, so it's not exported from libdrm_amdgpu.so.1 * Add amdgpu_get_marketing_name to amdgpu-symbols-check * Fix indentation of second line of if statement * Squash in another change removing redundant entries * Change spelling of "RADEON" -> "Radeon" * Remove "(TM)" from a minority of entries v4: [Michel Dänzer] * Use const char* instead of fixed size array for marketing_name (Emil Velikov) Signed-off-by: Junwei Zhang <jerry.zh...@amd.com> Reviewed-by: Flora Cui <flora....@amd.com> Signed-off-by: Michel Dänzer <michel.daen...@amd.com> Reviewed-by: Christian König <christian.koe...@amd.com> Reviewed-by: Alex Deucher <alexander.deuc...@amd.com> diff --git a/amdgpu/amdgpu-symbol-check b/amdgpu/amdgpu-symbol-check index 648db9b..87f4fd2 100755 --- a/amdgpu/amdgpu-symbol-check +++ b/amdgpu/amdgpu-symbol-check @@ -35,6 +35,7 @@ amdgpu_cs_submit amdgpu_cs_wait_semaphore amdgpu_device_deinitialize amdgpu_device_initialize +amdgpu_get_marketing_name amdgpu_query_buffer_size_alignment amdgpu_query_crtc_from_id amdgpu_query_firmware_version diff --git a/amdgpu/amdgpu.h b/amdgpu/amdgpu.h index 5d5a2c6..7b26a04 100644 --- a/amdgpu/amdgpu.h +++ b/amdgpu/amdgpu.h @@ -1245,4 +1245,14 @@ int amdgpu_cs_wait_semaphore(amdgpu_context_handle ctx, */ int amdgpu_cs_destroy_semaphore(amdgpu_semaphore_handle sem); +/** + * Get the ASIC marketing name + * + * \param dev - \c [in] Device handle. See #amdgpu_device_initialize() + * + * \return the constant string of the marketing name + * "NULL" means the ASIC is not found +*/ +const char *amdgpu_get_marketing_name(amdgpu_device_handle dev); + #endif /* #ifdef _AMDGPU_H_ */ diff --git a/amdgpu/amdgpu_asic_id.h b/amdgpu/amdgpu_asic_id.h new file mode 100644 index 0000000..3e7d736 --- /dev/null +++ b/amdgpu/amdgpu_asic_id.h @@ -0,0 +1,165 @@ +/* + * Copyright © 2016 Advanced Micro Devices, Inc. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + */ + +#ifndef __AMDGPU_ASIC_ID_H__ +#define __AMDGPU_ASIC_ID_H__ + +static struct amdgpu_asic_id_table_t { + uint32_t did; + uint32_t rid; + const char *marketing_name; +} const amdgpu_asic_id_table [] = { + {0x6600, 0x0, "AMD Radeon HD 8600/8700M"}, + {0x6600, 0x81, "AMD Radeon R7 M370"}, + {0x6601, 0x0, "AMD Radeon HD 8500M/8700M"}, + {0x6604, 0x0, "AMD Radeon R7 M265 Series"}, + {0x6604, 0x81, "AMD Radeon R7 M350"}, + {0x6605, 0x0, "AMD Radeon R7 M260 Series"}, + {0x6605, 0x81, "AMD Radeon R7 M340"}, + {0x6606, 0x0, "AMD Radeon HD 8790M"}, + {0x6607, 0x0, "AMD Radeon HD8530M"}, + {0x6608, 0x0, "AMD FirePro W2100"}, + {0x6610, 0x0, "AMD Radeon HD 8600 Series"}, + {0x6610, 0x81, "AMD Radeon R7 350"}, + {0x6610, 0x83, "AMD Radeon R5 340"}, + {0x6611, 0x0, "AMD Radeon HD 8500 Series"}, + {0x6613, 0x0, "AMD Radeon HD 8500 series"}, + {0x6617, 0xC7, "AMD Radeon R7 240 Series"}, + {0x6640, 0x0, "AMD Radeon HD 8950"}, + {0x6640, 0x80, "AMD Radeon R9 M380"}, + {0x6646, 0x0, "AMD Radeon R9 M280X"}, + {0x6646, 0x80, "AMD Radeon R9 M470X"}, + {0x6647, 0x0, "AMD Radeon R9 M270X"}, + {0x6647, 0x80, "AMD Radeon R9 M380"}, + {0x6649, 0x0, "AMD FirePro W5100"}, + {0x6658, 0x0, "AMD Radeon R7 200 Series"}, + {0x665C, 0x0, "AMD Radeon HD 7700 Series"}, + {0x665D, 0x0, "AMD Radeon R7 200 Series"}, + {0x665F, 0x81, "AMD Radeon R7 300 Series"}, + {0x6660, 0x0, "AMD Radeon HD 8600M Series"}, + {0x6660, 0x81, "AMD Radeon R5 M335"}, + {0x6660, 0x83, "AMD Radeon R5 M330"}, + {0x6663, 0x0, "AMD Radeon HD 8500M Series"}, + {0x6663, 0x83, "AMD Radeon R5 M320"}, + {0x6664, 0x0, "AMD Radeon R5 M200 Series"}, + {0x6665, 0x0, "AMD Radeon R5 M200 Series"}, + {0x6665, 0x83, "AMD Radeon R5 M320"}, + {0x6667, 0x0, "AMD Radeon R5 M200 Series"}, + {0x666F, 0x0, "AMD Radeon HD 8500M"}, + {0x6780, 0x0, "ATI FirePro V (FireGL V) Graphics Adapter"}, + {0x678A, 0x0, "ATI FirePro V (FireGL V) Graphics Adapter"}, + {0x6798, 0x0, "AMD Radeon HD 7900 Series"}, + {0x679A, 0x0, "AMD Radeon HD 7900 Series"}, + {0x679B, 0x0, "AMD Radeon HD 7900 Series"}, + {0x679E, 0x0, "AMD Radeon HD 7800 Series"}, + {0x67A0, 0x0, "HAWAII XTGL (67A0)"}, + {0x67A1, 0x0, "HAWAII GL40 (67A1)"}, + {0x67B0, 0x0, "AMD Radeon R9 200 Series"}, + {0x67B0, 0x80, "AMD Radeon R9 390 Series"}, + {0x67B1, 0x0, "AMD Radeon R9 200 Series"}, + {0x67B1, 0x80, "AMD Radeon R9 390 Series"}, + {0x67B9, 0x0, "AMD Radeon R9 200 Series"}, + {0x67DF, 0xC4, "AMD Radeon RX 480 Graphics"}, + {0x67DF, 0xC5, "AMD Radeon RX 470 Graphics"}, + {0x67DF, 0xC7, "AMD Radeon RX 480 Graphics"}, + {0x67DF, 0xCF, "AMD Radeon RX 470 Graphics"}, + {0x67C4, 0x00, "AMD Radeon Pro WX 7100 Graphics"}, + {0x67C7, 0x00, "AMD Radeon Pro WX 5100 Graphics"}, + {0x67C0, 0x00, "AMD Radeon Pro WX 7100 Graphics"}, + {0x67E0, 0x00, "AMD Radeon Pro WX Series Graphics"}, + {0x67E3, 0x00, "AMD Radeon Pro WX 4100 Graphics"}, + {0x67E8, 0x00, "AMD Radeon Pro WX Series Graphics"}, + {0x67E8, 0x01, "AMD Radeon Pro WX Series Graphics"}, + {0x67E8, 0x80, "AMD Radeon E9260 Graphics"}, + {0x67EB, 0x00, "AMD Radeon Pro WX Series Graphics"}, + {0x67EF, 0xC0, "AMD Radeon RX Graphics"}, + {0x67EF, 0xC1, "AMD Radeon RX 460 Graphics"}, + {0x67EF, 0xC5, "AMD Radeon RX 460 Graphics"}, + {0x67EF, 0xC7, "AMD Radeon RX Graphics"}, + {0x67EF, 0xCF, "AMD Radeon RX 460 Graphics"}, + {0x67EF, 0xEF, "AMD Radeon RX Graphics"}, + {0x67FF, 0xC0, "AMD Radeon RX Graphics"}, + {0x67FF, 0xC1, "AMD Radeon RX Graphics"}, + {0x6800, 0x0, "AMD Radeon HD 7970M"}, + {0x6801, 0x0, "AMD Radeon(TM) HD8970M"}, + {0x6808, 0x0, "ATI FirePro V(FireGL V) Graphics Adapter"}, + {0x6809, 0x0, "ATI FirePro V(FireGL V) Graphics Adapter"}, + {0x6810, 0x0, "AMD Radeon(TM) HD 8800 Series"}, + {0x6810, 0x81, "AMD Radeon R7 370 Series"}, + {0x6811, 0x0, "AMD Radeon(TM) HD8800 Series"}, + {0x6811, 0x81, "AMD Radeon R7 300 Series"}, + {0x6818, 0x0, "AMD Radeon HD 7800 Series"}, + {0x6819, 0x0, "AMD Radeon HD 7800 Series"}, + {0x6820, 0x0, "AMD Radeon HD 8800M Series"}, + {0x6820, 0x81, "AMD Radeon R9 M375"}, + {0x6820, 0x83, "AMD Radeon R9 M375X"}, + {0x6821, 0x0, "AMD Radeon HD 8800M Series"}, + {0x6821, 0x87, "AMD Radeon R7 M380"}, + {0x6821, 0x83, "AMD Radeon R9 M370X"}, + {0x6822, 0x0, "AMD Radeon E8860"}, + {0x6823, 0x0, "AMD Radeon HD 8800M Series"}, + {0x6825, 0x0, "AMD Radeon HD 7800M Series"}, + {0x6827, 0x0, "AMD Radeon HD 7800M Series"}, + {0x6828, 0x0, "ATI FirePro V(FireGL V) Graphics Adapter"}, + {0x682B, 0x0, "AMD Radeon HD 8800M Series"}, + {0x682B, 0x87, "AMD Radeon R9 M360"}, + {0x682C, 0x0, "AMD FirePro W4100"}, + {0x682D, 0x0, "AMD Radeon HD 7700M Series"}, + {0x682F, 0x0, "AMD Radeon HD 7700M Series"}, + {0x6835, 0x0, "AMD Radeon R7 Series / HD 9000 Series"}, + {0x6837, 0x0, "AMD Radeon HD7700 Series"}, + {0x683D, 0x0, "AMD Radeon HD 7700 Series"}, + {0x683F, 0x0, "AMD Radeon HD 7700 Series"}, + {0x6900, 0x0, "AMD Radeon R7 M260"}, + {0x6900, 0x81, "AMD Radeon R7 M360"}, + {0x6900, 0x83, "AMD Radeon R7 M340"}, + {0x6901, 0x0, "AMD Radeon R5 M255"}, + {0x6907, 0x0, "AMD Radeon R5 M255"}, + {0x6907, 0x87, "AMD Radeon R5 M315"}, + {0x6920, 0x0, "AMD Radeon R9 M395X"}, + {0x6920, 0x1, "AMD Radeon R9 M390X"}, + {0x6921, 0x0, "AMD Radeon R9 M295X"}, + {0x6929, 0x0, "AMD FirePro S7150"}, + {0x692B, 0x0, "AMD FirePro W7100"}, + {0x6938, 0x0, "AMD Radeon R9 200 Series"}, + {0x6938, 0xF0, "AMD Radeon R9 200 Series"}, + {0x6938, 0xF1, "AMD Radeon R9 380 Series"}, + {0x6939, 0xF0, "AMD Radeon R9 200 Series"}, + {0x6939, 0x0, "AMD Radeon R9 200 Series"}, + {0x6939, 0xF1, "AMD Radeon R9 380 Series"}, + {0x7300, 0xC8, "AMD Radeon R9 Fury Series"}, + {0x7300, 0xCB, "AMD Radeon R9 Fury Series"}, + {0x7300, 0xCA, "AMD Radeon R9 Fury Series"}, + {0x9874, 0xC4, "AMD Radeon R7 Graphics"}, + {0x9874, 0xC5, "AMD Radeon R6 Graphics"}, + {0x9874, 0xC6, "AMD Radeon R6 Graphics"}, + {0x9874, 0xC7, "AMD Radeon R5 Graphics"}, + {0x9874, 0x81, "AMD Radeon R6 Graphics"}, + {0x9874, 0x87, "AMD Radeon R5 Graphics"}, + {0x9874, 0x85, "AMD Radeon R6 Graphics"}, + {0x9874, 0x84, "AMD Radeon R7 Graphics"}, + + {0x0000, 0x0, "\0"}, +}; +#endif diff --git a/amdgpu/amdgpu_device.c b/amdgpu/amdgpu_device.c index e5a923e..f4ede03 100644 --- a/amdgpu/amdgpu_device.c +++ b/amdgpu/amdgpu_device.c @@ -44,6 +44,7 @@ #include "amdgpu_internal.h" #include "util_hash_table.h" #include "util_math.h" +#include "amdgpu_asic_id.h" #define PTR_TO_UINT(x) ((unsigned)((intptr_t)(x))) #define UINT_TO_PTR(x) ((void *)((intptr_t)(x))) @@ -303,3 +304,17 @@ int amdgpu_device_deinitialize(amdgpu_device_handle dev) amdgpu_device_reference(&dev, NULL); return 0; } + +const char *amdgpu_get_marketing_name(amdgpu_device_handle dev) +{ + const struct amdgpu_asic_id_table_t *t = amdgpu_asic_id_table; + + while (t->did) { + if ((t->did == dev->info.asic_id) && + (t->rid == dev->info.pci_rev_id)) + return t->marketing_name; + t++; + } + + return NULL; +} commit e9eb44b45b8d4a2f06ef83365b28eca55c0f3fb4 Author: Rob Clark <robcl...@freedesktop.org> Date: Mon Aug 15 13:26:18 2016 -0400 freedreno: add fence fd support Signed-off-by: Rob Clark <robcl...@freedesktop.org> diff --git a/freedreno/freedreno_drmif.h b/freedreno/freedreno_drmif.h index 2d913e6..7a8073f 100644 --- a/freedreno/freedreno_drmif.h +++ b/freedreno/freedreno_drmif.h @@ -92,6 +92,7 @@ int fd_device_fd(struct fd_device *dev); enum fd_version { FD_VERSION_MADVISE = 1, /* kernel supports madvise */ FD_VERSION_UNLIMITED_CMDS = 1, /* submits w/ >4 cmd buffers (growable ringbuffer) */ + FD_VERSION_FENCE_FD = 2, /* submit command supports in/out fences */ }; enum fd_version fd_device_version(struct fd_device *dev); diff --git a/freedreno/freedreno_priv.h b/freedreno/freedreno_priv.h index cdfdbe8..86da83b 100644 --- a/freedreno/freedreno_priv.h +++ b/freedreno/freedreno_priv.h @@ -133,7 +133,8 @@ struct fd_ringmarker { struct fd_ringbuffer_funcs { void * (*hostptr)(struct fd_ringbuffer *ring); - int (*flush)(struct fd_ringbuffer *ring, uint32_t *last_start); + int (*flush)(struct fd_ringbuffer *ring, uint32_t *last_start, + int in_fence_fd, int *out_fence_fd); void (*grow)(struct fd_ringbuffer *ring, uint32_t size); void (*reset)(struct fd_ringbuffer *ring); void (*emit_reloc)(struct fd_ringbuffer *ring, diff --git a/freedreno/freedreno_ringbuffer.c b/freedreno/freedreno_ringbuffer.c index 22dafb3..c132145 100644 --- a/freedreno/freedreno_ringbuffer.c +++ b/freedreno/freedreno_ringbuffer.c @@ -80,10 +80,15 @@ void fd_ringbuffer_reset(struct fd_ringbuffer *ring) ring->funcs->reset(ring); } -/* maybe get rid of this and use fd_ringmarker_flush() from DDX too? */ int fd_ringbuffer_flush(struct fd_ringbuffer *ring) { - return ring->funcs->flush(ring, ring->last_start); + return ring->funcs->flush(ring, ring->last_start, -1, NULL); +} + +int fd_ringbuffer_flush2(struct fd_ringbuffer *ring, int in_fence_fd, + int *out_fence_fd) +{ + return ring->funcs->flush(ring, ring->last_start, in_fence_fd, out_fence_fd); } void fd_ringbuffer_grow(struct fd_ringbuffer *ring, uint32_t ndwords) @@ -177,5 +182,5 @@ uint32_t fd_ringmarker_dwords(struct fd_ringmarker *start, int fd_ringmarker_flush(struct fd_ringmarker *marker) { struct fd_ringbuffer *ring = marker->ring; - return ring->funcs->flush(ring, marker->cur); + return ring->funcs->flush(ring, marker->cur, -1, NULL); } diff --git a/freedreno/freedreno_ringbuffer.h b/freedreno/freedreno_ringbuffer.h index 8899b5d..108d5a6 100644 --- a/freedreno/freedreno_ringbuffer.h +++ b/freedreno/freedreno_ringbuffer.h @@ -56,6 +56,11 @@ void fd_ringbuffer_set_parent(struct fd_ringbuffer *ring, struct fd_ringbuffer *parent); void fd_ringbuffer_reset(struct fd_ringbuffer *ring); int fd_ringbuffer_flush(struct fd_ringbuffer *ring); +/* in_fence_fd: -1 for no in-fence, else fence fd + * out_fence_fd: NULL for no output-fence requested, else ptr to return out-fence + */ +int fd_ringbuffer_flush2(struct fd_ringbuffer *ring, int in_fence_fd, + int *out_fence_fd); void fd_ringbuffer_grow(struct fd_ringbuffer *ring, uint32_t ndwords); uint32_t fd_ringbuffer_timestamp(struct fd_ringbuffer *ring); diff --git a/freedreno/kgsl/kgsl_ringbuffer.c b/freedreno/kgsl/kgsl_ringbuffer.c index 7b3298a..e4696b1 100644 --- a/freedreno/kgsl/kgsl_ringbuffer.c +++ b/freedreno/kgsl/kgsl_ringbuffer.c @@ -113,7 +113,8 @@ static void * kgsl_ringbuffer_hostptr(struct fd_ringbuffer *ring) return kgsl_ring->bo->hostptr; } -static int kgsl_ringbuffer_flush(struct fd_ringbuffer *ring, uint32_t *last_start) +static int kgsl_ringbuffer_flush(struct fd_ringbuffer *ring, uint32_t *last_start, + int in_fence_fd, int *out_fence_fd) { struct kgsl_ringbuffer *kgsl_ring = to_kgsl_ringbuffer(ring); struct kgsl_pipe *kgsl_pipe = to_kgsl_pipe(ring->pipe); @@ -131,6 +132,9 @@ static int kgsl_ringbuffer_flush(struct fd_ringbuffer *ring, uint32_t *last_star }; int ret; + assert(in_fence_fd == -1); + assert(out_fence_fd == NULL); + kgsl_pipe_pre_submit(kgsl_pipe); /* z180_cmdstream_issueibcmds() is made of fail: */ diff --git a/freedreno/msm/msm_ringbuffer.c b/freedreno/msm/msm_ringbuffer.c index 60f0315..5117df1 100644 --- a/freedreno/msm/msm_ringbuffer.c +++ b/freedreno/msm/msm_ringbuffer.c @@ -395,7 +395,8 @@ static void dump_submit(struct msm_ringbuffer *msm_ring) } } -static int msm_ringbuffer_flush(struct fd_ringbuffer *ring, uint32_t *last_start) +static int msm_ringbuffer_flush(struct fd_ringbuffer *ring, uint32_t *last_start, + int in_fence_fd, int *out_fence_fd) { struct msm_ringbuffer *msm_ring = to_msm_ringbuffer(ring); struct drm_msm_gem_submit req = { @@ -404,6 +405,15 @@ static int msm_ringbuffer_flush(struct fd_ringbuffer *ring, uint32_t *last_start uint32_t i; int ret; + if (in_fence_fd != -1) { + req.flags |= MSM_SUBMIT_FENCE_FD_IN | MSM_SUBMIT_NO_IMPLICIT; + req.fence_fd = in_fence_fd; + } + + if (out_fence_fd) { + req.flags |= MSM_SUBMIT_FENCE_FD_OUT; + } +