aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i915
Commit message (Collapse)AuthorAgeFilesLines
* program: convert _mesa_init_gl_program() to take struct gl_program *Emil Velikov2015-10-151-4/+5
| | | | | | | | Rather than accepting a void pointer, only to down and up cast around it, convert the function to take the base (struct gl_program) pointer. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* program: remove _mesa_init_*_program wrappersMarek Olšák2015-10-091-4/+3
| | | | | | | They didn't do anything useful. Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* util: Move DRI parse_debug_string() to utilKristian Høgsberg Kristensen2015-10-081-2/+3
| | | | | | | | | | We want to use intel_debug.c in code that doesn't link to dri common. v2: Remove unnecessary stddef.h include (Topi), use util/debug.h in all DRI driver and remove driParseDebugString() (Iago). Reviewed-by: Topi Pohjolainen <[email protected]> Signed-off-by: Kristian Høgsberg Kristensen <[email protected]>
* i915: remove unneeded #include of colormac.hMark Janes2015-10-062-2/+0
| | | | Reviewed-by: Matt Turner <[email protected]>
* i915: Drop broken front_buffer_reading/drawing optimizationVille Syrjälä2015-10-063-41/+15
| | | | | | | | | | | | | | | | | | | | | Bring the following commit over to i915: commit ec542d74578bbef6b55125dd6aba1dc7f5079e65 Author: Eric Anholt <[email protected]> Date: Mon Mar 3 10:43:10 2014 -0800 i965: Drop broken front_buffer_reading/drawing optimization. Not sure if it might fix anything, but since the i965 and i915 used to share a bunch of that code, it would seem reasonable the same problems could be present in the i915 code still, and the i965 approach is well tested by now so bringing it over seems fairly safe. No piglit regressions on 855. v2: Rebase on _mesa_is_front_buffer_* refactor. Signed-off-by: Ville Syrjälä <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* i915: Don't override NewFramebuffer just to call _mesa_new_framebufferIan Romanick2015-10-062-15/+0
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* i830: Fix culling with user fbos on gen2Ville Syrjälä2015-10-061-0/+2
| | | | | | | | | | | | Flip the cull bits when rendering to a user fbo on gen2. This was already done on gen3 (since before git history starts) but was missing from the gen2 code. Fixes rendering of the driver+kart model in supertuxkart kart selection screen. Signed-off-by: Ville Syrjälä <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* i915: Adjust line size limitsVille Syrjälä2015-10-061-2/+2
| | | | | | | | | | | | The hardware can draw lines 0.5 to 7.5 pixels wide. Adjust the limits to 1.0-7.0. The old limits seems to be from the era when i915 and i965 were sharing this code. Not really sure if 1.0-7.0 is correct. Maybe it could be 0.5.7.5 as those are the hw limits, or maybe some combination of the two? Signed-off-by: Ville Syrjälä <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* i915: Enable intel_render path for pointsVille Syrjälä2015-10-061-5/+3
| | | | | | | | | | | | | | | | | | The sub-pixel adjustment for points was killed off in commit 60d762aa625095a8c1f9597d8530bb5a6fa61b4c Author: Xiang, Haihao <[email protected]> Date: Wed Jan 2 11:38:51 2008 +0800 i915: Needn't adjust pixel centers. fix #12944 so if we don't need it in intel_tris.c we don't need it in intel_render.c either, which means we can allow intel_render.c to render points. No apparent regressions on PNV in ES1 or ES2 conformance. Signed-off-by: Ville Syrjälä <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* i915: Use COPY_DWORDS for pointsVille Syrjälä2015-10-061-5/+1
| | | | | | | | | | | | | | The sub-pixel adjustment for points was killed off in commit 60d762aa625095a8c1f9597d8530bb5a6fa61b4c Author: Xiang, Haihao <[email protected]> Date: Wed Jan 2 11:38:51 2008 +0800 i915: Needn't adjust pixel centers. fix #12944 so we can just as well use COPY_DWORDS(). Signed-off-by: Ville Syrjälä <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* i915: Use _tnl_RenderClippedPolygon and _tnl_RenderClippedLineVille Syrjälä2015-10-061-17/+2
| | | | | | | | _tnl_RenderClippedPolygon and _tnl_RenderClippedLine already do most of what we want so use them. Signed-off-by: Ville Syrjälä <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* i915: Handle provoking vertex in intelFastRenderClippedPoly()Ville Syrjälä2015-10-061-4/+12
| | | | | | | | | | | | | | intelFastRenderClippedPoly() renders the polygon using triangles. For polygons the provoking vertex is always the first one, and currently this function assumes that the provoking vertex for triangles is the last one. In case the user changed the provoking vertex convention, the hardware may be configured to treat the first vertex of triangles as the provoking vertex. So check the convention and emit the triangles in the appropriate order to avoid having to change the hardware provoking vertex convention for rendering polygons. Signed-off-by: Ville Syrjälä <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* i915: Use C99 initializers for primitive arraysVille Syrjälä2015-10-062-50/+50
| | | | | | | | | Using C99 initializers for the primitive arrays makes things more readable. Signed-off-by: Ville Syrjälä <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* mesa: remove Driver.AccumMarek Olšák2015-10-031-1/+0
| | | | | | | Nothing calls it. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* i915: Remember to call intel_prepare_render() before blittingVille Syrjälä2015-09-301-0/+5
| | | | | | | | | | | | | | | | | Bring over the following fix from i965: commit fb3d62fe3d4fc40ba4ad9804d8b6f451316c9ae2 Author: Kenneth Graunke <[email protected]> Date: Tue Aug 6 14:36:09 2013 -0700 i965: Remember to call intel_prepare_render() before blitting. Fixes a crash in the following piglit tests: bin/fbo-sys-blit -auto bin/fbo-sys-sub-blit -auto Signed-off-by: Ville Syrjälä <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Cc: "11.0" <[email protected]>
* i915: Fix texcoord vs. varying collision in fragment programsVille Syrjälä2015-09-302-26/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | i915 fragment programs utilize the texture coordinate registers for both texture coordinates and varyings. Unfortunately the code doesn't check if the same index might be in use for both. It just naively uses the index to pick a texture unit, which could lead to collisions. Add an extra mapping step to allocate non conflicting texture units for both uses. The issue can be reproduced with a pair of simple shaders like these: attribute vec4 in_mod; varying vec4 mod; void main() { mod = in_mod; gl_TexCoord[0] = gl_MultiTexCoord0; gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } varying vec4 mod; uniform sampler2D tex; void main() { gl_FragColor = texture2D(tex, vec2(gl_TexCoord[0])) * mod; } Fixes many piglit tests on i915: glsl-link-varyings-2 glsl-orangebook-ch06-bump interpolation-none-gl_frontcolor-smooth-fixed interpolation-none-gl_frontcolor-smooth-none interpolation-none-gl_frontcolor-smooth-vertex interpolation-none-gl_frontsecondarycolor-smooth-fixed interpolation-none-gl_frontsecondarycolor-smooth-vertex interpolation-none-gl_frontsecondarycolor-smooth-none interpolation-none-other-flat-fixed interpolation-none-other-flat-none interpolation-none-other-flat-vertex interpolation-none-other-smooth-fixed interpolation-none-other-smooth-none interpolation-none-other-smooth-vertex v2 [idr]: Minor formatting tweaks. Signed-off-by: Ville Syrjälä <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Cc: "11.0" <[email protected]>
* i830: Fix collision between I830_UPLOAD_RASTER_RULES and I830_UPLOAD_TEX(0)Ville Syrjälä2015-09-301-4/+4
| | | | | | | | | | | | | | I830_UPLOAD_RASTER_RULES and I830_UPLOAD_TEX(0) are trying to occupy the same bit. Move the texture bits upwards a bit to make room for I830_UPLOAD_RASTER_RULES. Now the driver will actually upload the raster rules which is rather important to get the provoking vertex right. Fixes the appearance of glxgears teeth on gen2. Signed-off-by: Ville Syrjälä <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Cc: "10.6 11.0" <[email protected]>
* i915: Make hw_prim[] constVille Syrjälä2015-09-231-1/+1
| | | | | | | | The table used to map the GL primitive to the hw primitive never changes so make it const. Signed-off-by: Ville Syrjälä <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Remove unused HAVE_TRI_STRIP_1 definesIan Romanick2015-09-231-1/+0
| | | | | | | Defined to 0 in a few places, but it's not used anywhere. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* t_dd_dmatmp: Remove HAVE_QUADS supportIan Romanick2015-09-231-1/+0
| | | | | | | | | Two drivers use this file, and neither supports quads. No piglit regressions on i915 (G33) or radeon (Radeon 7500). Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* t_dd_dmatmp: Remove HAVE_QUAD_STRIPS supportIan Romanick2015-09-231-1/+0
| | | | | | | | | Two drivers use this file, and neither supports quad strips. No piglit regressions on i915 (G33) or radeon (Radeon 7500). Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* t_dd_dmatmp: Make "count" actually be the countIan Romanick2015-09-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | The value passed in count previously was "vertex after the last vertex to be processed." Calling that "count" was misleading and kind of mean. Looking at the code, many functions immediately do "count-start" to get back the true count. That's just silly. If it is better for the loops to be 'for (j = start; j < (start + count); j++)', GCC will do that transformation. NOTE: There is some strange formatting left by this patch. That was done to make it more obvious that the before and after code is equivalent. These will be fixed in the next patch. No piglit regressions on i915 (G33) or radeon (Radeon 7500). v2: Fix a remaining (count-start) in render_quad_strip_verts. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> [v1] Cc: "10.6 11.0" <[email protected]>
* i915, i965: Silence unused parameter warnings in intel_batchbuffer_advanceIan Romanick2015-09-101-0/+2
| | | | | | | | | | | | | These only occurred in release builds, but they occurred in every file that included intel_batchbuffer.h. Lots of spam. :( intel_batchbuffer.h: In function 'intel_batchbuffer_advance': intel_batchbuffer.h:153:47: warning: unused parameter 'brw' [-Wunused-parameter] intel_batchbuffer_advance(struct brw_context *brw) ^ Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* i915: Silence unused parameter warning in intel_miptree_create_layoutIan Romanick2015-09-103-15/+5
| | | | | | | | | | | | | | The for_bo parameter of intel_miptree_create_layout appears to be unused since 27eedca when Eric removed some Gen5 code (after the i915 and i965 drivers parted ways). intel_mipmap_tree.c: In function 'old_intel_miptree_create_layout': intel_mipmap_tree.c:77:35: warning: unused parameter 'for_bo' [-Wunused-parameter] bool for_bo) ^ Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* i915, i965: Silence unused parameter warnings in intel_miptree_unmap_gttIan Romanick2015-09-101-6/+2
| | | | | | | | | | | | | | | | intel_mipmap_tree.c: In function 'intel_miptree_unmap_gtt': intel_mipmap_tree.c:777:34: warning: unused parameter 'map' [-Wunused-parameter] struct intel_miptree_map *map, ^ intel_mipmap_tree.c:778:17: warning: unused parameter 'level' [-Wunused-parameter] unsigned int level, ^ intel_mipmap_tree.c:779:17: warning: unused parameter 'slice' [-Wunused-parameter] unsigned int slice) ^ Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* i915: Silence unused parameter warningsIan Romanick2015-09-103-7/+5
| | | | | | | | | | intel_mipmap_tree.c: In function 'old_intel_miptree_unmap_raw': intel_mipmap_tree.c:726:51: warning: unused parameter 'intel' [-Wunused-parameter] intel_miptree_unmap_raw(struct intel_context *intel, ^ Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* i915: Remove prototype for nonexistent brw_miptree_layoutIan Romanick2015-09-101-2/+0
| | | | | | | | Hasn't existed in the i915 source since the i915 and i965 drivers parted ways. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* i915, i965: Silence unused parameter warnings in intel_mipmap_tree.hIan Romanick2015-09-101-0/+4
| | | | | | | | | | | | | | | | | | | These only occurred in release builds, but they occurred in every file that included intel_mipmap_tree.h. Lots of spam. :( intel_mipmap_tree.h: In function 'intel_miptree_check_level_layer': intel_mipmap_tree.h:595:59: warning: unused parameter 'mt' [-Wunused-parameter] intel_miptree_check_level_layer(struct intel_mipmap_tree *mt, ^ intel_mipmap_tree.h:596:42: warning: unused parameter 'level' [-Wunused-parameter] uint32_t level, ^ intel_mipmap_tree.h:597:42: warning: unused parameter 'layer' [-Wunused-parameter] uint32_t layer) ^ Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* mesa/formats: remove compressed formats from matching functionNanley Chery2015-08-252-2/+2
| | | | | | | | | | | | | | | All compressed formats return GL_FALSE and there isn't any evidence to support that this behaviour would change. Remove all switch cases for compressed formats. v2. Since the exhaustive switch is removed, add a gtest to ensure all formats are handled. v3. Ensure that GL_NO_ERROR is set before returning. v4. Fix an arg to _mesa_uncompressed_format_to_type_and_comps(); fix formatting and misc improvements (Chad). Reviewed-by: Chad Versace <[email protected]> Signed-off-by: Nanley Chery <[email protected]>
* Delete duplicate function is_power_of_two() and use _mesa_is_pow_two()Anuj Phogat2015-07-291-1/+1
| | | | | | Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa: Use floats for viewport bounds.Matt Turner2015-07-291-1/+1
| | | | | | | | | | | | | | | | | | ARB_viewport_array specifies that DEPTH_RANGE consists of double- precision parameters (corresponding commit d4dc35987), and a preparatory commit (6340e609a) added _mesa_get_viewport_xform() which returned double-precision scale[3] and translate[3] vectors, even though X, Y, Width, and Height were still floats. All users of _mesa_get_viewport_xform() immediately convert the double scale and translation vectors into floats (which were floats originally, but were converted to doubles in _mesa_get_viewport_xform(), sigh). i965 at least cannot consume doubles (see SF_CLIP_VIEWPORT). If we want to pass doubles to hardware, we should have a different function that does that. Acked-by: Mathias Froehlich <[email protected]>
* mesa: Rename _mesa_lookup_enum_by_nr() to _mesa_enum_to_string().Kenneth Graunke2015-07-207-17/+17
| | | | | | | Generated by sed; no manual changes. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* i915: remove unused driFd variableEmil Velikov2015-07-132-3/+0
| | | | | Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* i915: use EmitNoIndirectSamplerTapani Pälli2015-06-301-0/+3
| | | | | | Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Francisco Jerez <[email protected]> Cc: "10.5" and "10.6" <[email protected]>
* program: Shrink and rename SaturateMode field to Saturate.Matt Turner2015-06-031-1/+1
| | | | | | | | | | | It was 2 bits to accommodate SATURATE_PLUS_MINUS_ONE (removed by commit 09b566e1). A similar change was made to TGSI recently in commit e1c4e8aa. Reducing the size from 2 bits to 1 reduces the size of the bit fields from 17 bits to 16, which is a much nicer number. Reviewed-by: Brian Paul <[email protected]>
* Revert "i915: Enable ARB_direct_state_access"Ian Romanick2015-05-281-1/+0
| | | | | | | This reverts commit 121030eed8fc41789d2f4f7517bbc0dd6199667b. Acked-by: Fredrik Höglund <[email protected]> Cc: "10.6" <[email protected]>
* i915: Enable ARB_direct_state_accessFredrik Höglund2015-05-141-0/+1
| | | | | | | This extension requires OpenGL 2.0, so enable it on gen3 and later. Signed-off-by: Fredrik Höglund <[email protected]> Reviewed-by: Adam Jackson <[email protected]>
* main: Refactor _mesa_update_draw_buffer_bounds.Laura Ekstrand2015-05-142-2/+2
| | | | | Reviewed-by: Fredrik Höglund <[email protected]> Signed-off-by: Fredrik Höglund <[email protected]>
* main: Refactor _mesa_update_framebuffer.Laura Ekstrand2015-05-142-2/+2
| | | | | | | | | _mesa_update_framebuffer now operates on arbitrary read and draw framebuffers. This allows BlitNamedFramebuffer to update the state of its arbitrary read and draw framebuffers. Reviewed-by: Fredrik Höglund <[email protected]> Signed-off-by: Fredrik Höglund <[email protected]>
* main: Rename framebuffer renderbuffer software fallback.Laura Ekstrand2015-05-141-1/+1
| | | | | | | | | Rename _mesa_framebuffer_renderbuffer to _mesa_FramebufferRenderbuffer_sw in preparation for adding the ARB_direct_state_access backend function for FramebufferRenderbuffer and NamedFramebufferRenderbuffer to share. Reviewed-by: Fredrik Höglund <[email protected]> Signed-off-by: Fredrik Höglund <[email protected]>
* i915/sync: Return early when calloc failsChad Versace2015-05-071-0/+2
| | | | | Reviewed-by: Daniel Stone <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i915/sync: Don't crash when deleting sync objectChad Versace2015-05-071-1/+3
| | | | | | | | | Don't pass NULL to drm_intel_bo_unreference(). It doesn't like that. Bug found by code inspection. Reviewed-by: Daniel Stone <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* Fix a few typosZoë Blade2015-04-274-7/+7
| | | | Reviewed-by: Francisco Jerez <[email protected]>
* android: fix the building rules for Android 5.0Chih-Wei Huang2015-04-221-0/+4
| | | | | | | | | | | | | | | | | Android 5.0 allows modules to generate source into $OUT/gen, which will then be copied into $OUT/obj and $OUT/obj_$(TARGET_2ND_ARCH) as necessary. Modules will need to change calls to local-intermediates-dir into local-generated-sources-dir. The patch changes local-intermediates-dir into local-generated-sources-dir. If the Android version is less than 5.0, fallback to local-intermediates-dir. The patch also fixes the 64-bit building issue of Android 5.0. v2 [Emil Velikov] - Keep the LOCAL_UNSTRIPPED_PATH variable. Signed-off-by: Chih-Wei Huang <[email protected]>
* i915: replace __FUNCTION__ with __func__Marius Predut2015-04-1424-107/+107
| | | | | | | | Consistently just use C99's __func__ everywhere. No functional changes. Acked-by: Matt Turner <[email protected]> Signed-off-by: Marius Predut <[email protected]>
* i915: add parens to silence operator precedence warningBrian Paul2015-03-111-1/+1
| | | | Signed-off-by: Brian Paul <[email protected]>
* i915: Fix GCC unused-but-set-variable warning in release build.Vinson Lee2015-03-091-4/+1
| | | | | | | | | | i915_fragprog.c: In function ‘i915ValidateFragmentProgram’: i915_fragprog.c:1453:11: warning: variable ‘k’ set but not used [-Wunused-but-set-variable] int k; ^ Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* i915: Remove unused IS_GEN2 macroIan Romanick2015-03-091-5/+0
| | | | | | | | Inspired by Damien's recent libdrm changes. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Damien Lespiau <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* i915: Remove (mostly) unused IS_915 macroIan Romanick2015-03-091-5/+3
| | | | | | | | Inspired by Damien's recent libdrm changes. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Damien Lespiau <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* i915: Remove (mostly) unused IS_PNV, IS_PNVG, and IS_PNVGM macrosIan Romanick2015-03-091-5/+3
| | | | | | | | Inspired by Damien's recent libdrm changes. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Damien Lespiau <[email protected]> Reviewed-by: Jordan Justen <[email protected]>