aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* meson,configure: include config.h automaticallyEric Engestrom2018-03-201-4/+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>
* amdgpu: fix "add AMDGPU_VA_RANGE_HIGH"Christian König2018-02-281-2/+2
| | | | | | | | | The range is stored as exclusive, not inclusive. Subtracts one to get the inclusive interval for the calculation. This fixes crashes when 32bit addresses are in use. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-and-Tested-by: Michel Dänzer <michel.daenzer@amd.com>
* amdgpu: add AMDGPU_VA_RANGE_HIGHChristian König2018-02-281-2/+4
| | | | | | | Return high addresses if requested and available. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
* amdgpu: mostly revert "use the high VA range if possible v2"Christian König2018-02-281-13/+15
| | | | | | | | | | | | This reverts commit 07ea20d5beb24315b721adf83bbfa72ce016e146. Unfortunately it turned out that this change broke some corner cases in Mesa. Revert it for now, but keep the high range in separate VA managers. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
* amdgpu: add amdgpu_query_sw_info for querying high bits of 32-bit address spaceMarek Olšák2018-02-091-0/+14
| | | | Reviewed-by: Christian König <christian.koenig@amd.com>
* amdgpu: fix high VA maskChristian König2018-01-231-1/+1
| | | | | | | | | That constant needs to be 64bits. Fixes: amdgpu: use the high VA range if possible v2 Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
* amdgpu: use the high VA range if possible v2Christian König2018-01-091-4/+14
| | | | | | | | | Retire the low range on Vega10 this frees up everything below 0xffff800000000000 for HMM. v2: keep the 32bit range working. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
* amdgpu: fix 32bit VA manager max addressChristian König2018-01-091-1/+1
| | | | | | | The range is exclusive not inclusive. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
* amdgpu: Only remember the device's marketing nameMichel Dänzer2017-12-051-20/+3
| | | | | | | | | There's no point in keeping around the full table of marketing names, when amdgpu_get_marketing_name only ever returns the device's marketing name. Acked-by: Slava Abramov <slava.abramov@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
* amdgpu: Clean up amdgpu_parse_asic_ids error handlingMichel Dänzer2017-12-011-5/+1
| | | | | | | | | | | * Move error message printing into amdgpu_parse_asic_ids and make it return void * Print only "Invalid format" error message if parse_one_line returns -EINVAL * Use strerror instead of printing the (negative) error code in hex Acked-by: Slava Abramov <slava.abramov@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
* Revert "amdgpu: fix 32bit VA manager max address"Christian König2017-11-091-1/+1
| | | | | | | | This reverts commit 944f6665de36b6a6c36263f23b7b9d1730e544fa. Accidentially pushed an imcomplete patch. Signed-off-by: Christian König <christian.koenig@amd.com>
* Revert "amdgpu: use the high VA range if possible"Christian König2017-11-091-7/+2
| | | | | | | | This reverts commit 6c0ea4b0c5452bfc1e67b74ce723696ef3c80b25. Accidentially pushed an incomplete patch. Signed-off-by: Christian König <christian.koenig@amd.com>
* amdgpu: use the high VA range if possibleChristian König2017-11-081-2/+7
| | | | | | This frees up the low range for HMM. Signed-off-by: Christian König <christian.koenig@amd.com>
* amdgpu: fix 32bit VA manager max addressChristian König2017-11-081-1/+1
| | | | | | The range is exclusive not inclusive. Signed-off-by: Christian König <christian.koenig@amd.com>
* amdgpu: sanitize 64bit VA managerChristian König2017-11-081-18/+6
| | | | | | | Adding the extra reservation of the 32bit space to the 64bit manager is complete nonsense and just a waste of memory and CPU cycles. Signed-off-by: Christian König <christian.koenig@amd.com>
* amdgpu: print error messages when amdgpu_device_initialize is failingMarek Olšák2017-09-281-3/+16
| | | | Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
* amdgpu: move asic id table to a separate fileXiaojie Yuan2017-06-121-7/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | v2: fix an off by one error and leading white spaces v3: use thread safe strtok_r(); initialize len before calling getline(); change printf() to drmMsg(); add initial amdgpu.ids v4: integrate some recent internal changes, including format changes v5: fix line number for empty/commented lines; realloc to save memory; indentation changes v6: remove a line error v7: [Michel Dänzer] * Move amdgpu.ids to new data directory * Remove placeholder entries from amdgpu.ids * Set libdrmdatadir variable in configure.ac instead of Makefile.am [Emil Velikov] * Use isblank() instead of open-coding it [Emil Velikov] * Don't leak asic_id_table memory if realloc fails [Emil Velikov] * Check and bump table_max_size at the beginning of the while loop [Emil Velikov] * Initialize table_max_size to the number of entries in data/amdgpu.ids v8: [Michel Dänzer] * Make sure amdgpu_asic_id.c gets rebuilt when amdgpu.ids changes Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Signed-off-by: Samuel Li <Samuel.Li@amd.com>
* amdgpu: vamgr can be a struct instead of a pointerAlex Xie2017-02-021-11/+5
| | | | | | | | | | | | vamgr is an integral part of amdgpu_device. We don't need to calloc and free it. This can save CPU time, reduce heap fragmentation. Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Signed-off-by: Alex Xie <AlexBin.Xie@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> [Grazvydas Ignotas: rebase, correct a typo in commit message] Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* amdgpu: vamgr_32 can be a struct instead of a pointerAlex Xie2017-02-021-6/+2
| | | | | | | | | | | | vamgr_32 is an integral part of amdgpu_device. We don't need to calloc and free it. This can save CPU time, reduce heap fragmentation. Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Signed-off-by: Alex Xie <AlexBin.Xie@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> [Grazvydas Ignotas: rebase, correct a typo in commit message] Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* amdgpu: Free/uninit vamgr_32 in theoretically correct orderAlex Xie2017-02-021-2/+2
| | | | | | | | | | | vamgr_32 is a region inside general VAM range. It is better to free and deinitialize it before general VAM range. Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Signed-off-by: Alex Xie <AlexBin.Xie@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* amdgpu: add the function to get the marketing name (v4)Junwei Zhang2016-11-071-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | 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.Zhang@amd.com> Reviewed-by: Flora Cui <Flora.Cui@amd.com> Signed-off-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
* amdgpu: fix missing deinit on vamgr_32monk.liu2015-09-021-0/+2
| | | | | | | Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: monk.liu <monk.liu@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* amdgpu: make vamgr per device v2Jammy Zhou2015-08-171-2/+11
| | | | | | | | | | | Each device can have its own vamgr, so make it per device now. This can fix the failure with multiple GPUs used in one single process. v2: rebase Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com>
* amdgpu: add flag to support 32bit VA address v4Jammy Zhou2015-08-171-0/+20
| | | | | | | | | | | | | | | | | The AMDGPU_VA_RANGE_32_BIT flag is added to request VA range in the 32bit address space for amdgpu_va_range_alloc. The 32bit address space is reserved at initialization time, and managed with a separate VAMGR as part of the global VAMGR. And if no enough VA space available in range above 4GB, this reserved range can be used as fallback. v2: add comment for AMDGPU_VA_RANGE_32_BIT, and add vamgr to va_range v3: rebase to Emil's drm_private series v4: fix one warning Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com>
* amdgpu: hide the final internal functions from global namespaceEmil Velikov2015-08-131-22/+36
| | | | | | | | | | Thus the only symbols that we export are the ones officially provided by the API. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
* amdgpu: cosmetic chances in license boilerplateEmil Velikov2015-08-131-2/+1
| | | | | | | Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
* amdgpu: add a bunch of missing config.h includesEmil Velikov2015-08-131-0/+4
| | | | | | | Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
* libdrm/amdgpu: Use private fd for amdgpu_device and winsys hash table to fix ↵Mario Kleiner2015-08-051-4/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | ZaphodHeads. (v2) The amdgpu_device for a device node needs its own dup'ed fd, instead of using the original fd passed in for a screen, to make multi-x-screen ZaphodHeads configurations work on amdgpu. The original fd's lifetime differs from that of the amdgpu_device, and from the one stored in the hash. The hash key is the fd, and in order to compare hash entries we fstat them, so the fd must be around for as long as the amdgpu_device is. This patch for libdrm/amdgpu is a translation of the radeon-winsys ZaphodHeads fix for mesa's radeon-winsys, from mesa commit 28dda47ae4d974e3e032d60e8e0965c8c068c6d8 "winsys/radeon: Use dup fd as key in drm-winsys hash table to fix ZaphodHeads." Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com> Acked-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> v2: Check for valid fd's being >= 0, because fd == 0 is in theory a valid, although unlikely, fd and fd == -1 would denote an invalid fd. Thanks to William Lewis for pointing this out. Reported-by: William Lewis <minutemaidpark@hotmail.com> Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
* amdgpu: fix valgrind warningsMarek Olšák2015-08-051-1/+1
| | | | Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
* amdgpu: make vamgr globalKen Wang2015-08-051-2/+2
| | | | | | | | | This is the first sub-patch of va interface task, the va task is about adding more va management interfaces for UMD, by design, the vamgr should be per-process rather than per-device. Signed-off-by: Ken Wang <Qingqing.Wang@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com>
* amdgpu: remove bo_vas hash table v2Christian König2015-08-051-2/+0
| | | | | | | | Not used any more. v2: Keep accidental removed lines. Signed-off-by: Christian König <christian.koenig@amd.com>
* amdgpu: fix a valgrind warningMarek Olšák2015-08-051-1/+1
| | | | | | | | ==10307== Conditional jump or move depends on uninitialised value(s) ==10307== at 0xB9F4CFA: amdgpu_device_initialize (amdgpu_device.c:193) Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
* amdgpu: compare the primary device names insteadChristian König2015-08-051-18/+27
| | | | | | | | | Instead of taking a look at the device major/minor we just compare the primary device name to figure out if two fds are pointing to the same device. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Christian König <christian.koenig@amd.com>
* drm: add libdrm_amdgpu (v7)Alex Deucher2015-08-051-0/+241
This is the new ioctl wrapper used by the new admgpu driver. It's primarily used by xf86-video-amdgpu and mesa. v2: fix amdgpu_drm.h install v3: Integrate some of the sugestions from Emil: clean up Makefile.am, configure.ac capitalize header guards fix _FILE_OFFSET_BITS with config.h use drm_mmap/drm_munmap Remove unused ARRAY_SIZE macro use shared list implementation use shared math implementation use drmGetNodeTypeFromFd helper v4: remove unused tiling defines v5: include amdgpu.h in Makefile.am v6: update amdgpu_drm.h v7: libdrm.h -> libdrm_macros.h Signed-off-by: Alex Deucher <alexander.deucher@amd.com>