summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/intel/intel_screen.h
AgeCommit message (Collapse)AuthorFilesLines
2013-06-26i965: Move the remaining intel code to the i965 directory.Eric Anholt1-89/+0
Now that i915's forked off, they don't need to live in a shared directory. Acked-by: Kenneth Graunke <kenneth@whitecape.org> Acked-by: Chad Versace <chad.versace@linux.intel.com> Acked-by: Adam Jackson <ajax@redhat.com> (and I hear second hand that idr is OK with it, too)
2013-06-26intel: Drop little bits of dead code.Eric Anholt1-5/+0
I noticed these while building the fork-i915 branch. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-05-20i965: Bump kernel requirement to 3.3 on Ivybridge.Kenneth Graunke1-2/+0
Kernel 3.3 introduced the SOL reset execbuf parameter, needed for GL 3.0 on Ivybridge. Bumping the requirement will give an obvious error message rather than simply reporting GL 2.1. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-03-05intel: Remove the struct intel_region reuse hash table.Eric Anholt1-1/+0
I don't see any reason for it -- it was introduced with the DRI2 invalidate work by krh in 2010 with no explanation. I suspect it was something about wanting the same drm_intel_bo struct underneath multiple openings of the BO within one process, but that's covered by libdrm at this point. As far as the struct region goes, it is not threadsafe, so multiple contexts sharing a region could have mixed up the map_count and assertion failed or worse. Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-01-15intel: Set screen's api mask according to hw capabilities (v3)Chad Versace1-0/+5
Before this patch, intelInitScreen2 set DRIScreen::api_mask with the hacky heuristic below: if (gen >= 3) api_mask = GL | GLES1 | GLES2; else api_mask = 0; This hack was likely broken on gen2 (i830), but I don't care enough to properly investigate. It appears that every EGLConfig on i830 has EGL_RENDERABLE_TYPE=0, and thus eglCreateContext will never succeed. Anyway, moving on to living drivers... With the arrival of EGL_OPENGL_ES3_BIT_KHR, this heuristic is now insufficient. We must enable the GLES3 bit if and only if the driver is capable of creating a GLES3 context. This requires us to determine the maximum supported context version supported by the hardware/driver for each api *during initialization of intel_screen*. Therefore, this patch adds four new fields to intel_screen which indicate the maximum supported context version for each api: max_gl_core_version max_gl_compat_version max_gl_es1_version max_gl_es2_version The api mask is now correctly set as: api_mask = GL; if (max_gl_es1_version > 0) api_mask |= GLES1; if (max_gl_es2_version > 0) api_mask |= GLES2; Tested against gen6 with piglit egl-create-context-verify-gl-flavor. Verified that this patch does not change the set of exposed EGL context flavors. v2: - Replace the if-tree on gen with a switch, for Ian. - Unconditionally enable the DRI_API_OPENGL bit, for Ian. v3: - Drop max gl version to 1.4 on gen3 if !has_occlusion_query, because occlusion queries entered core in 1.5. For Ian. v4: - Drop ES2 version back to 2.0 due to rebase (Ian). Signed-off-by: Chad Versace <chad.versace@linux.intel.com> Reviewed-by: Ian Romanick <ian.d.romanick.intel.com>
2013-01-12i965: Move program_id to intel_screen instead of brw_context.Kenneth Graunke1-0/+5
According to bug #54524, I regressed oglconform's multicontext test when I reenabled the fragment shader precompile. However, these test cases only passed by miraculous coincedence. We assign each fragment program a unique ID (brw_fragment_program::id which becomes brw_wm_prog_key::program_string_id) which we obtain by storing a per-context counter. The test case uses GLX context sharing to access the same fragment program from two different contexts. This means that we share a program cache. Before the precompile, if both contexts happened to use the same shaders in the same order, we'd obtain the same program_string_ids (by virtue of doing the same computation twice). However, the more likely scenario is that they completely disagree on program_string_id. This meant that we'd have two completely different fragment shaders in the cache with the same ID, tricking us to think they were the same (aside from NOS), so we'd render using the wrong program. This patch implements a simple fix suggested by Eric: it moves the global counter out of brw_context and into intel_screen, which is shared across all contexts. A mutex protects it from concurrent access. This is also the first direct usage of pthreads in the i965 driver. Fixes 10 subcases of oglconform's multicontext test. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54524 Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-12i965: Add perf debug for stalls during shader compiles.Eric Anholt1-0/+1
v2: fix bad comment from before I gave up and decided to just use doubles. Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-17intel: Convert to using private depth/stencil buffers (v2)Eric Anholt1-58/+0
This means that GLX buffer sharing of these no longer works. On the other hand, just *look* at this code reduction. v2: - [chad] Fix intelCreateBuffer for gen < 6. When the branch for !screen->hw_has_separate_stencil was taken, intel_create_private_renderbuffer was incorrectly not used. - [chad] Remove all code in intel_process_dri2_buffer for processing depth, stencil, and hiz buffers. That code is now dead. CC: Eric Anholt <eric@anholt.net> Signed-off-by: Chad Versace <chad.versace@linux.intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-02i965/aub: Dump a final bitmap from DestroyContext.Kenneth Graunke1-0/+2
Certain applications don't call SwapBuffers before exiting. Yet, we'd really like to see a bitmap containing the final rendered image even if they choose never to present it. In particular, Piglit tests (at least with -auto -fbo) fall into this category. Many of them failed to dump any images at all. Dumping one final image at context destruction time seems to work. We may wish to pursue a more elegant solution later. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-20i965: Change the hiz-override env var to a driconf option.Eric Anholt1-1/+0
The force-enable option is dropped, now that the hardware we were concerned about has HiZ on by default. Now, instead of doing INTEL_HIZ=0 to test disabling hiz, you can set hiz=false. v2: Disable separate stencil on gen6 when HIZ is turned off. (previously, this had to be done manually in addition). Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
2012-03-05i965: fixup W-tile offset computation to take swizzling into accountDaniel Vetter1-0/+1
There's even a comment in the code containing the right swizzling computations! Previously this has not been noticed because we need to manually enabled swizzling on snb/ivb (kernel 3.4 will do that) and we don't use the separate stencil on ilk (where the bios enables swizzling). This fixes piglit ./bin/fbo-stencil readpixels GL_DEPTH32F_STENCIL8 -auto on recent drm-intel-next kernels. Also remove the comment about ivb, it's stale now. Swizzling detection is done by allocating a temporary x-tiled buffer object. Unfortunately kernels before v3.2 lie on snb/ivb because they claim that swizzling is enable, but it isn't. The kernel commit that fixes this for backport to pre-v3.2 is commit acc83eb5a1e0ae7dbbf89ca2a1a943ade224bb84 Author: Daniel Vetter <daniel.vetter@ffwll.ch> Date: Mon Sep 12 20:49:16 2011 +0200 drm/i915: fix swizzling on gen6+ But if the kernel doesn't lie, this now works on swizzling and not swizzling machines. NOTE: This is a candidate for the 8.0 branch. Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-04intel: verify if hardware has LLC supportEugeni Dodonov1-0/+2
Rely on libdrm HAS_LLC parameter to verify if hardware supports it. In case the libdrm version does not supports this check, fallback to older way of detecting it which assumed that GPUs newer than GEN6 have it. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Signed-off-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
2012-01-06i965/gen7: Enable transform feedback as long as kernel support is present.Eric Anholt1-0/+2
The last major issue (intervening-read) is fixed, so let's turn this on for real. The only other known issue is a hardware limitation for tesselation with flat shading. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
2011-10-18intel: Convert from GLboolean to 'bool' from stdbool.h.Kenneth Graunke1-6/+7
I initially produced the patch using this bash command: for file in {intel,i915,i965}/*.{c,cpp,h}; do [ ! -h $file ] && sed -i 's/GLboolean/bool/g' $file && sed -i 's/GL_TRUE/true/g' $file && sed -i 's/GL_FALSE/false/g' $file; done Then I manually added #include <stdbool.h> to fix compilation errors, and converted a few functions back to GLboolean that were used in core Mesa's function pointer table to avoid "incompatible pointer" warnings. Finally, I cleaned up some whitespace issues introduced by the change. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Acked-by: Chad Versace <chad@chad-versace.us> Acked-by: Paul Berry <stereotype441@gmail.com>
2011-07-19intel: Fix stencil buffer to be W tiledChad Versace1-3/+6
Until now, the stencil buffer was allocated as a Y tiled buffer, because in several locations the PRM states that it is. However, it is actually W tiled. From the PRM, 2011 Sandy Bridge, Volume 1, Part 2, Section 4.5.2.1 W-Major Format: W-Major Tile Format is used for separate stencil. The GTT is incapable of W fencing, so we allocate the stencil buffer with I915_TILING_NONE and decode the tile's layout in software. This fix touches the following portions of code: - In intel_allocate_renderbuffer_storage(), allocate the stencil buffer with I915_TILING_NONE. - In intel_verify_dri2_has_hiz(), verify that the stencil buffer is not tiled. - In the stencil buffer's span functions, the tile's layout must be decoded in software. This commit mutually depends on the xf86-video-intel commit dri: Do not tile stencil buffer Author: Chad Versace <chad@chad-versace.us> Date: Mon Jul 18 00:38:00 2011 -0700 On Gen6 with separate stencil enabled, fixes the following Piglit tests: bugs/fdo23670-drawpix_stencil general/stencil-drawpixels spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX16-copypixels spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX16-drawpixels spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX16-readpixels spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX1-copypixels spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX1-drawpixels spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX1-readpixels spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX4-copypixels spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX4-drawpixels spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX4-readpixels spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX8-copypixels spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX8-drawpixels spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX8-readpixels spec/EXT_packed_depth_stencil/fbo-stencil-GL_DEPTH24_STENCIL8-copypixels spec/EXT_packed_depth_stencil/fbo-stencil-GL_DEPTH24_STENCIL8-readpixels spec/EXT_packed_depth_stencil/readpixels-24_8 Note: This is a candidate for the 7.11 branch. Signed-off-by: Chad Versace <chad@chad-versace.us> Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-08intel: Request DRI2 buffers for separate stencil and hizChad Versace1-2/+0
When it is sensible to do so, 1) intelCreateBuffer() now attaches separate depth and stencil buffers to the framebuffer it creates. 2) intel_update_renderbuffers() requests for the framebuffer a separate stencil buffer (DRI2BufferStencil). The criteria for "sensible" is: - The GLX config has nonzero depth and stencil bits. - The hardware supports separate stencil. - The X driver supports separate stencil, or its support has not yet been determined. If the hardware supports hiz too, then intel_update_renderbuffers() also requests DRI2BufferHiz. If after requesting DRI2BufferStencil we determine that X driver did not actually support separate stencil, we clean up the mistake and never ask for DRI2BufferStencil again. CC: Ian Romanick <idr@freedesktop.org> CC: Kristian Høgsberg <krh@bitplanet.net> Acked-by: Eric Anholt <eric@anholt.net> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-08intel: Add flags to intel_screen for hiz and separate stencilChad Versace1-0/+10
Add the fields below to intel_screen. The expression in parens is the value to which intelInitScreen2() currently sets the field. GLboolean hw_has_separate_stencil (true iff gen >= 7) GLboolean hw_must_use_separate_stencil (true iff gen >= 7) GLboolean hw_has_hiz (always false) enum intel_dri2_has_hiz dri2_has_hiz (INTEL_DRI2_HAS_HIZ_UNKNOWN) The analogous fields in intel_context now inherit their values from intel_screen. When hiz and separate stencil become completely implemented for a given chipset, then the respective fields need to be enabled. CC: Ian Romanick <idr@freedesktop.org> CC: Kristian Høgsberg <krh@bitplanet.net> Acked-by: Eric Anholt <eric@anholt.net> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-08intel: Define enum intel_dri2_has_hizChad Versace1-0/+56
... which indicates if the X driver supports DRI2BufferHiz and DRI2BufferStencil. I'm placing this in its own commit due to the large comment block. CC: Ian Romanick <idr@freedesktop.org> CC: Kristian Høgsberg <krh@bitplanet.net> Acked-by: Eric Anholt <eric@anholt.net> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-04-26intel: Set gen in intelInitScreen, just copy value in intelInitContextKristian Høgsberg1-0/+1
2011-03-01i965: Use negative relocation deltas to minimse vertex uploadsChris Wilson1-0/+1
With relaxed relocation checking in the kernel, we can specify a negative delta (i.e. pointing outside of the target bo) in order to fake a range in a large buffer. We only then need to upload the elements used and adjust the buffer offset such that they correspond with the indices used in the DrawArrays. (Depends on libdrm 0209428b3918c4336018da9293cdcbf7f8fedfb6) Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-03-04intel: Remove non-kernel-exec-fencing support.Eric Anholt1-1/+0
Shaves 60k off the driver from removing the broken spans code. This means we now require 2.6.29, which seems fair given that it's a year old and we've removed support for non-KMS already in the last release of 2D.
2010-02-12intel: Track named regions and make sure we only have one region per named boKristian Høgsberg1-0/+1
2010-02-11i915: Remove always-true irq_active struct intel_screen fieldKristian Høgsberg1-2/+0
2010-02-11i915: Remove a few DRI1 era struct intel_screen fieldsKristian Høgsberg1-7/+0
2010-02-11i915: Drop intelScreenPrivate typedef and just call it struct intel_screenKristian Høgsberg1-8/+2
2010-02-11i915: Remove unused intelRegion structKristian Høgsberg1-23/+0
Phew, sure is nice to only have one struct called intel region.
2010-01-04Remove leftover __DRI{screen,drawable,context}Private referencesKristian Høgsberg1-7/+7
As part of the DRI driver interface rewrite I merged __DRIscreenPrivate and __DRIscreen, and likewise for __DRIdrawablePrivate and __DRIcontextPrivate. I left typedefs in place though, to avoid renaming all the *Private use internal to the driver. That was probably a mistake, and it turns out a one-line find+sed combo can do the mass rename. Better late than never.
2009-11-19intel: Remove non-GEM support.Eric Anholt1-1/+0
This really isn't supported at this point. GEM's been in the kernel for a year, and the fake bufmgr never really worked.
2009-04-06i965: Use GTT maps when available to upload vertex arrays and system VBOs.Eric Anholt1-0/+1
This speeds up OA on my GM45 by 21% (more than the original CPU cost of the upload path). We might still be able to squeeze a few more percent out by avoiding repeatedly mapping/unmapping buffers as we upload elements into them.
2009-01-26intel: make intelUpdateScreenFromSAREA() staticBrian Paul1-4/+0
2009-01-26intel: Move swap-related functions from intel_buffers.c to new ↵Brian Paul1-5/+0
intel_swapbuffers.c
2009-01-20[intel] Go back to using the typedef for the sarea structmesa_7_3_rc3Timo Aaltonen1-2/+2
The upstream linux kernel headers and libdrm kernel headers disagree on the tag name for the sarea struct: _drm_i915_sarea vs drm_i915_sarea. They both typedef it to drm_i915_sarea_t though, so just use that.
2008-12-23Remove third buffer support from Mesa.Dave Airlie1-1/+0
This is part of the deprecated pageflipping infrastructure.
2008-12-02intel: restore old vertex submit paths for i8xx hardware.Dave Airlie1-0/+1
Intel docs state that only 830/845 have VBOs, 855/865 don't. So lets just not use them on i8xx at all. This restores the old pre-vbo code and uses it on all 8xx hw.
2008-09-12intel: Remove dead allow_batchbuffer param.Eric Anholt1-1/+0
2008-09-10intel: track bufmgr move to libdrm_intel and bufmgr_fake irq emit/wait change.Eric Anholt1-2/+3
2008-09-10intel: Move the bufmgr back to the screen.Eric Anholt1-0/+4
Mesa requires that we be able to share objects between contexts, which means that the objects need to be created by the same bufmgr, and the bufmgr internally requires pthread protection for thread safety. Rely on the bufmgr having appropriate locking.
2008-08-24Revert "Revert "Merge branch 'drm-gem'""Dave Airlie1-0/+2
This reverts commit 7c81124d7c4a4d1da9f48cbf7e82ab1a3a970a7a.
2008-08-24Revert "Merge branch 'drm-gem'"Dave Airlie1-2/+0
This reverts commit 53675e5c05c0598b7ea206d5c27dbcae786a2c03. Conflicts: src/mesa/drivers/dri/i965/brw_wm_surface_state.c
2008-07-11drm-gem: Use new GEM ioctls for tiling state, and support new swizzle modes.Eric Anholt1-6/+0
2008-07-02intel-gem: Fix Y-tiling span setup.Eric Anholt1-0/+6
The boolean that the server gives us for whether the region is tiled was getting used as the enum for what tiling mode. Instead, guess the correct tiling in screen setup. Also, fix the Y-tiling pitch setup. The pitch to the next tile in Y is 32 scanlines, not 8.
2008-05-06[intel-GEM] Add tiling support to swrast.Keith Packard1-0/+2
Accessing tiled surfaces without using the fence registers requires that software deal with the address swizzling itself.
2008-02-22Use drm_i915_sarea instead of drmI830Sarea and remove i830_common.hAlan Hourihane1-2/+2
2008-01-22[intel] Clean up references to screen buffer metrics.Kristian Høgsberg1-6/+1
The screen wide info such as pitch and cpp are obsoleted by the FBO changes, so clean up the last few references to those, except for setting up the legacy screen regions.
2007-12-12[intel] Move bufmgr back to context instead of screen, fixing glthreads.Eric Anholt1-17/+0
Putting the bufmgr in the screen is not thread-safe since the emit_reloc changes. It also led to a significant performance hit from pthread usage for the attempted thread-safety (up to 12% of a cpu spent on refcounting protection in single-threaded 965). The motivation had been to allow multi-context bufmgr sharing in classic mode, but it wasn't worth the cost.
2007-11-26i915: Catch cases where not all state is emitted for a new batchbuffer.Keith Whitwell1-0/+2
This could lead to incorrect rendering or even lockups.
2007-11-16[intel] Add 965 support to shared intel_blit.cEric Anholt1-0/+6
This requires that regions grow a marker of whether they are tiled or not, because fence (surface) registers are ignored by the 965 2D engine.
2007-11-09[i915] Remove old frontbuffer rotation hack.Eric Anholt1-11/+0
This was replaced in previous releases of xserver/dri/libGL by reporting the damage to the frontbuffer so that the server and driver could handle it appropriately.
2007-11-09[intel] Move over files that will be shared with 965-fbo work.Eric Anholt1-0/+134