summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* i965: Make a screen::aperture_threshold field.Kenneth Graunke2017-04-102-3/+6
| | | | | | | | | | | | This is the threshold after which drm_intel_bufmgr_check_aperture_space returns -ENOSPC, signalling that it thinks an execbuf is likely to fail and we need to roll back and flush the batch. We'll need this when we rewrite aperture space checking, shortly. In the meantime, we can also use it in GLX_MESA_query_renderer. Reviewed-by: Chris Wilson <[email protected]> Acked-by: Jason Ekstrand <[email protected]>
* i965: Make/use a brw_batch_references() wrapper.Kenneth Graunke2017-04-1011-14/+21
| | | | | | | We'll want to change the implementation of this shortly. Reviewed-by: Chris Wilson <[email protected]> Acked-by: Jason Ekstrand <[email protected]>
* i965: Use brw_emit_reloc() instead of drm_bacon_bo_emit_reloc().Kenneth Graunke2017-04-1011-95/+82
| | | | | | | | I'm about to make brw_emit_reloc do actual work, so everybody needs to start using it and not the raw drm_bacon function. Reviewed-by: Chris Wilson <[email protected]> Acked-by: Jason Ekstrand <[email protected]>
* i965: Change intel_batchbuffer_reloc() into brw_emit_reloc().Kenneth Graunke2017-04-103-22/+18
| | | | | | | | | | | | | | This renames intel_batchbuffer_reloc to brw_emit_reloc and changes the parameter naming and ordering to match drm_intel_bo_emit_reloc(). For now, it's a trivial wrapper that accesses batch->bo. When we rework relocations, it will start doing actual work. target_offset should be expanded to a uint64_t to match the kernel, but for now we leave it as its original 32-bit type. Reviewed-by: Chris Wilson <[email protected]> Acked-by: Jason Ekstrand <[email protected]>
* i965/drm: Drop GEM_SW_FINISH stuff.Kenneth Graunke2017-04-101-24/+0
| | | | | | | | | | | This is only useful when doing an incoherent CPU mapping of the current scanout buffer. That's a terrible plan, so we never do it. We always use an uncached GTT map. So, this is useless. Drop the code. Reviewed-by: Chris Wilson <[email protected]> Acked-by: Jason Ekstrand <[email protected]>
* i965/drm: Drop code to search for an existing bufmgr.Kenneth Graunke2017-04-101-53/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This functionality was added by libdrm commit 743af59669386cb6e063fa4bd85f0a0b2da86295 (intel: make bufmgr_gem shareable from different API) in an attempt to solve libva/mesa buffer sharing problems. Specifically, this was working around an issue hit by Chromium, which used the same drm_fd for multiple APIs, and shared buffers between them. This code attempted to work around that issue by using the same bufmgr for both libva and Mesa. It worked because libdrm_intel was loaded by both libraries. However, now that Mesa has forked, we don't have a common library, and this code cannot work. The correct solution is to have each API open its own file descriptor (and get a corresponding buffer manager), and then use PRIME export and import to share BOs across those APIs. Then the kernel can manage those shared resources. According to Chris, the kernel will pass back the same handle for a prime FD if the lookup is from the same device FD. We believe Chromium has since moved to this model. In Mesa, there is already only one screen per FD, and so there will only be one bufmgr per FD. We don't need any of this code. v2: Add a big warning comment written by Chris Wilson. Reviewed-by: Chris Wilson <[email protected]> Acked-by: Jason Ekstrand <[email protected]>
* i965/drm: Unwrap the unnecessary drm_bacon_reloc_target_info struct.Kenneth Graunke2017-04-101-26/+19
| | | | | | | This used to have another field, but now it's just a BO pointer. Reviewed-by: Chris Wilson <[email protected]> Acked-by: Jason Ekstrand <[email protected]>
* i965/drm: Switch from uthash to Mesa's hash table.Kenneth Graunke2017-04-103-1103/+53
| | | | | | | | | | | | No performance data has been gathered about this choice. I just don't want that many hash tables. Chris points out that this is not performance critical - we should not be recreating that many handles from scratch. In the past we used a linear list, which became unreasonable in stress tests that used hundreds of thousands of BOs. In real usage, it shouldn't matter that much. Reviewed-by: Chris Wilson <[email protected]> Acked-by: Jason Ekstrand <[email protected]>
* i965/drm: Drop bo_gem::kflags.Kenneth Graunke2017-04-101-4/+1
| | | | | | | It's always zero now. Reviewed-by: Kenneth Graunke <[email protected]> Acked-by: Jason Ekstrand <[email protected]>
* i965/drm: Drop has_exec_async related API.Kenneth Graunke2017-04-102-66/+0
| | | | | | | | Mesa doesn't use this yet. We'll almost certainly want to, but we can add the functionality back after we clean up the messy drm code. Reviewed-by: Chris Wilson <[email protected]> Acked-by: Jason Ekstrand <[email protected]>
* i965/drm: Drop softpin support for now.Kenneth Graunke2017-04-102-143/+8
| | | | | | | | We may want this eventually, but simplify for now. We can add it back later when we actually intend to use it. Reviewed-by: Chris Wilson <[email protected]> Acked-by: Jason Ekstrand <[email protected]>
* i965/drm: Drop userptr support for now.Kenneth Graunke2017-04-102-204/+1
| | | | | | | | | | We'll want userptr support for GL_AMD_pinned_memory support someday, and possibly some other upload optimizations. Chris says "not in this form" though. Drop it and simplify for now - we can add it back later when we're ready to hook it up fully. Reviewed-by: Chris Wilson <[email protected]> Acked-by: Jason Ekstrand <[email protected]>
* i965/drm: Delete engine checks.Kenneth Graunke2017-04-101-35/+0
| | | | | | | | This is basically handholding to prevent a bogus caller from trying to execbuffer on a bogus engine. i965 already does this correctly. Reviewed-by: Chris Wilson <[email protected]> Acked-by: Jason Ekstrand <[email protected]>
* i965/drm: Drop intel_chipset.h in favor of using gen_device_info.Kenneth Graunke2017-04-105-576/+63
| | | | | | | | | | | | This moves the PCI ID detection to intel_screen.c and makes drm_bacon_bufmgr_gem_init() take a devinfo pointer. We also drop the HAS_LLC query stuff - devinfo has that info already, without kernel queries, and it makes no sense to have two has_llc flags set by different mechanisms. Reviewed-by: Chris Wilson <[email protected]> Acked-by: Jason Ekstrand <[email protected]>
* i965/drm: Drop deprecated drm_bacon_bo::offset.Kenneth Graunke2017-04-103-10/+1
| | | | | | | This field was the wrong size, so we replaced it with offset64. Reviewed-by: Chris Wilson <[email protected]> Acked-by: Jason Ekstrand <[email protected]>
* i965/drm: Drop has_wait_timeout.Kenneth Graunke2017-04-101-16/+0
| | | | | | | | The wait-ioctl was introduced in kernel v3.6 (20120930) and that is our current minimum requirement for screen creation. Reviewed-by: Chris Wilson <[email protected]> Acked-by: Jason Ekstrand <[email protected]>
* i965/drm: Assume aperture size query will work.Kenneth Graunke2017-04-101-15/+2
| | | | | | | This query has been available since 2.6.28. We require 3.6. Reviewed-by: Chris Wilson <[email protected]> Acked-by: Jason Ekstrand <[email protected]>
* i965/drm: Combine drm_bacon_bufmgr_gem and drm_bacon_bufmgr classes.Kenneth Graunke2017-04-103-405/+328
| | | | | | | | | The distinction was required when the bufmgr was virtualised, now there is only one class, we no longer need the distraction of pretending it is a subclass. Reviewed-by: Chris Wilson <[email protected]> Acked-by: Jason Ekstrand <[email protected]>
* i965/drm: Move _drm_bacon_context to intel_bufmgr_gem.c.Kenneth Graunke2017-04-102-5/+5
| | | | | | | | | | This moves us one step closer to killing off intel_bufmgr_priv.h. We might want to nuke it altogether, since it's basically just a uint32_t handle, but for now, let's focus on removing files. Reviewed-by: Chris Wilson <[email protected]> Acked-by: Jason Ekstrand <[email protected]>
* i965/drm: Drop cliprects and dr4 from execbuf variants.Kenneth Graunke2017-04-104-25/+12
| | | | | | | Legacy DRI1 leftovers. Reviewed-by: Chris Wilson <[email protected]> Acked-by: Jason Ekstrand <[email protected]>
* i965/drm: Devirtualize the bufmgr.Kenneth Graunke2017-04-105-646/+243
| | | | | | | | | libdrm_bacon used to have a GEM-based bufmgr and a legacy fake bufmgr, but that's long since dead (and we never imported it to i965). So, drop the extra layer of function pointers. Reviewed-by: Chris Wilson <[email protected]> Acked-by: Jason Ekstrand <[email protected]>
* i965/drm: Check INTEL_DEBUG & DEBUG_BUFMGR directly.Kenneth Graunke2017-04-105-19/+3
| | | | | | | | Eliminates some API around this, and more importantly, the last field in one bufmgr class. Reviewed-by: Chris Wilson <[email protected]> Acked-by: Jason Ekstrand <[email protected]>
* i965/drm: Use Mesa's macros.h instead of duplicating them.Kenneth Graunke2017-04-103-16/+3
| | | | | | | | | | | Replace the duplicated macros imported from libdrm: ARRAY_SIZE, MAX2, ALIGN, STATIC_ASSERT and remove unused ROUND_UP_TO and ROUND_UP_TO_MB. Reviewed-by: Chris Wilson <[email protected]> Acked-by: Jason Ekstrand <[email protected]>
* i965/drm: Use ALIGN, not ROUND_UP_TO.Kenneth Graunke2017-04-101-2/+2
| | | | | | | | ROUND_UP_TO handles a NPOT alignment, but all the alignments we use are power of two anyway, so there's no need. Reviewed-by: Chris Wilson <[email protected]> Acked-by: Jason Ekstrand <[email protected]>
* i965/drm: Delete execbuf1 support.Kenneth Graunke2017-04-101-181/+2
| | | | | | | execbuf2 has been around since v2.6.33. We require v3.6. Reviewed-by: Chris Wilson <[email protected]> Acked-by: Jason Ekstrand <[email protected]>
* i965/drm: Remove Gen2-3 fence accounting.Kenneth Graunke2017-04-103-234/+13
| | | | | | | | | | | Since gen4, we do not use fence registers for any GPU access and so never have to account for the fence during batch construction. All the related fence functions are unused. Based on Kristian Høgsberg's patch; commit message by Chris Wilson. Reviewed-by: Chris Wilson <[email protected]> Acked-by: Jason Ekstrand <[email protected]>
* i965/drm: Remove some unused functions and macros.Kenneth Graunke2017-04-105-266/+0
| | | | | | | | | | | Mesa doesn't use these functions or macros, so we can delete them, and save work refactoring and cleaning them up. We'll delete a lot more later, too. Based on a patch by Kristian Høgsberg. Reviewed-by: Chris Wilson <[email protected]> Acked-by: Jason Ekstrand <[email protected]>
* i965/drm: Switch to util/list.h instead of libdrm_lists.h.Kenneth Graunke2017-04-103-169/+45
| | | | | | | Both are kernel style lists, so this is trivial. Reviewed-by: Chris Wilson <[email protected]> Acked-by: Jason Ekstrand <[email protected]>
* i965/drm: Port to Mesa's atomic header.Kenneth Graunke2017-04-103-130/+26
| | | | | | | | | | Drop xf86atomic.h in favor of Mesa's util/u_atomic.h. We replace the atomic_t wrapper struct with a bare integer, switch to the 'p_atomic' naming conventions, and move over the one extra helper. Reviewed-by: Chris Wilson <[email protected]> Acked-by: Jason Ekstrand <[email protected]>
* i965/drm: Use our internal libdrm (drm_bacon) rather than the real one.Kenneth Graunke2017-04-1060-436/+442
| | | | | | Now we can actually test our changes. Acked-by: Jason Ekstrand <[email protected]>
* i965/drm: s/drm_intel/drm_bacon/gKenneth Graunke2017-04-104-606/+606
| | | | | | | | | | | | | | | | Using drm_intel_* as a prefix is hazardous - we don't want to conflict with the actual libdrm_intel symbols. In particular, I think we could get into trouble during the final megadrivers linking. So, rename everything to an different yet arbitrary prefix. bacon and intel are the same number of characters, so we don't have to reindent the world. It's also an homage to Ian's "Bacon Trail" platform. I was going to use "drm_relic" to poke fun at libdrm being ancient, and so we could explain the name with a "historical reasons" pun, but it sounds too much like ralloc. Acked-by: Jason Ekstrand <[email protected]>
* i965/drm: Drop libpciaccess dependencies.Kenneth Graunke2017-04-102-49/+0
| | | | | | | | | | | | | | | | | | | | i965 doesn't use drm_intel_get_aperture_sizes(), so we can delete support for it. This avoids a build dependency on libpciaccess. Chris also notes: "There's a really old bug that hopefully has been closed already (although as far as I can tell, it has never been fixed) about how using libpciaccess from libdrm_intel breaks the world (since libpciaccess uses a singleton that is torn down at the first request rather than upon the last user)." This bug should go away in two commits when we switch over to our internal copy of libdrm_intel. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=84325 Reviewed-by: Chris Wilson <[email protected]> Acked-by: Jason Ekstrand <[email protected]>
* i965/drm: Make libdrm_lists.h compile by defining typeof.Kenneth Graunke2017-04-101-0/+4
| | | | | | | typeof doesn't seem to exist, so this won't compile (but we don't yet try). Define it to __typeof__. This code is going to die soon anyway. Acked-by: Jason Ekstrand <[email protected]>
* i965/drm: remove legacy defines, aub functions, and decoder prototypesKenneth Graunke2017-04-102-176/+0
| | | | | | | | | We never imported any of this code, so drop the prototypes, unused enums, and defines. Based on patches by Emil Velikov. Acked-by: Jason Ekstrand <[email protected]>
* i965: Import libdrm_intel.Kenneth Graunke2017-04-109-0/+6724
| | | | | | | | | | | | | | This imports commit 19c4cfc54918d361f2535aec16650e9f0be667cd of libdrm/intel/*.[ch], minus a few files that we're never going to use (and would immediately delete), plus a few necessary dependencies. We rename intel_bufmgr.h to brw_bufmgr.h to avoid #include conflicts. We also fix UTF-8 symbol problems in intel_bufmgr_gem.c comments because vim keeps trying to fix that every time I edit the file, and we may as well fix it right away. Acked-by: Chris Wilson <[email protected]> Acked-by: Jason Ekstrand <[email protected]>
* i965: Make sure we don't use CPU maps for the scanout buffer.Kenneth Graunke2017-04-101-1/+13
| | | | | | | | | | | | | | | | | | | | Using an incoherent CPU map on the active scanout buffer is really sketchy - we may need extra flushing via GEM_SW_FINISH, or using drmModeDirtyFB() and kernel commit a6a7cc4b7db6d (4.10+). Chris suggests "never ever do that", which seems like a wise plan! intel_miptree_map_raw() uses CPU maps on linear buffers. Having a linear scanout buffer should be really rare, and mapping the front buffer should be similarly rare. Together, it should basically never happen. But, in case it does somehow...make sure that mapping the scanout buffer always goes through an uncached GTT map. v2: Add a giant comment written by Chris Wilson. Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Chris Wilson <[email protected]>
* i965: Stop calling drm_intel_bufmgr_gem_enable_fenced_relocs().Kenneth Graunke2017-04-101-2/+0
| | | | | | | This does nothing on Gen4+, which is the only hardware we support. Reviewed-by: Chris Wilson <[email protected]> Acked-by: Jason Ekstrand <[email protected]>
* i965: Fix GLX_MESA_query_renderer video memory on 32-bit.Kenneth Graunke2017-04-101-4/+12
| | | | | | | | | | | | | | | | | | | | | | | On modern systems with 4GB apertures, the size in bytes is 4294967296, or (1ull << 32). The kernel gives us the aperture size as a __u64, which works out great. Unfortunately, libdrm "helpfully" returns the data as a size_t, which on 32-bit systems means it truncates the aperture size to 0 bytes. We've happily reported this value as 0 MB of video memory via GLX_MESA_query_renderer since it was originally exposed. This patch bypasses libdrm and calls the ioctl ourselves so we can use a proper uint64_t, avoiding the 32-bit integer overflow. We now report a proper video memory size on 32-bit systems. Chris points out that the aperture size (CPU mappable size limit) isn't really the right thing to be checking. But libdrm_intel uses it to fail execbuffer, so it is an actual limit for now. Once that's fixed we can probably move to something else. In the meantime, fix the obvious typecasting bug. Reviewed-by: Jason Ekstrand <[email protected]>
* gallium/radeon: add HUD queries for GPU temperature and clocksSamuel Pitoiset2017-04-102-7/+12
| | | | | | | | | | | | | | | Only the Radeon kernel driver exposed the GPU temperature and the shader/memory clocks, this implements the same functionality for the AMDGPU kernel driver. These queries will return 0 if the DRM version is less than 3.10, I don't explicitely check the version here because the query codepath is already a bit messy. v2: - rebase on top of master Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* configure.ac: require libdrm_amdgpu 2.4.79Samuel Pitoiset2017-04-101-1/+1
| | | | | | | The sensor info requires amdgpu_query_sensor_info(). Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* radeonsi: add new si_check_render_feedback_texture() helperSamuel Pitoiset2017-04-101-45/+44
| | | | | | | For bindless. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* radeonsi: add new si_decompress_color_texture() helperSamuel Pitoiset2017-04-101-13/+17
| | | | | | | For bindless. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* radeonsi: add new depth_needs_decompression() helperSamuel Pitoiset2017-04-101-2/+8
| | | | | | | v2: - rename to depth_needs_decompression() instead Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* radeonsi: add a 'break' in si_check_render_feedback_*()Samuel Pitoiset2017-04-101-2/+6
| | | | | | | No need to check all color buffers. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* radeonsi: re-use 'desc' in si_set_shader_image()Samuel Pitoiset2017-04-101-2/+1
| | | | | | | No need to compute the offset in the descriptor twice. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* ac: add unreachable() in ac_build_image_opcode()Samuel Pitoiset2017-04-101-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | To silent the following compiler warning: common/ac_llvm_build.c: In function ‘ac_build_image_opcode’: common/ac_llvm_build.c:1080:3: warning: ‘name’ may be used uninitialized in this function [-Wmaybe-uninitialized] snprintf(intr_name, sizeof(intr_name), "%s%s%s%s.v4f32.%s.v8i32", ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ name, ~~~~~ a->compare ? ".c" : "", ~~~~~~~~~~~~~~~~~~~~~~~ a->bias ? ".b" : ~~~~~~~~~~~~~~~~ a->lod ? ".l" : ~~~~~~~~~~~~~~~ a->deriv ? ".d" : ~~~~~~~~~~~~~~~~~ a->level_zero ? ".lz" : "", ~~~~~~~~~~~~~~~~~~~~~~~~~~~ a->offset ? ".o" : "", ~~~~~~~~~~~~~~~~~~~~~~ type); ~~~~~ Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* r600g: get rid of dummy pixel shaderConstantine Kharlamov2017-04-103-40/+30
| | | | | | | | | | | | | | | | The idea is taken from radeonsi. The code mostly was already checking for null pixel shader, so little checks had to be added. Interestingly, acc. to testing with GTAⅣ, though binding of null shader happens a lot at the start (then just stops), but draw_vbo() never actually sees null ps. v2: added a check I missed because of a macros using a prefix to choose a shader. Signed-off-by: Constantine Kharlamov <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* r600g: add draw_vbo check for a NULL pixel shaderConstantine Kharlamov2017-04-104-2/+10
| | | | | | | | Taken from radeonsi, required to remove dummy pixel shader in the next patch Signed-off-by: Constantine Kharlamov <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* r600g: skip repeating vs, gs, and tes shader bindsConstantine Kharlamov2017-04-101-1/+7
| | | | | | | | | | | | | | | | | | | The idea is taken from radeonsi. The code lacks some checks for null vs, and I'm unsure about some changes against that, so I left it in place. Some statistics for GTAⅣ: Average tesselation bind skip per frame: ≈350 Average geometric shaders bind skip per frame: ≈260 Skip of binding vertex ones occurs rarely enough to not get into per-frame counter at all, so I just gonna say: it happens. v2: I've occasionally removed an empty line, don't do this. v3: return a check for null tes and gs back, while I haven't figured out the way to move stride assignment to r600_update_derived_state() (as it is in radeonsi). Signed-off-by: Constantine Kharlamov <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* mesa: use single memcpy when strides match in glReadPixels, texstore codeBartosz Tomczyk2017-04-102-9/+21
| | | | | | v2: fix indentation Reviewed-by: Brian Paul <[email protected]>