summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2013-10-14glx/tests: Add unit tests for the DRI2 part of GLX_MESA_query_rendererquery-rendererIan Romanick3-6/+314
After adding $(DEFINES) to AM_CPPFLAGS, the __glXGetCurrentContext wrapper function is no longer needed and causes compile errors. Using the correct defines causes it to be a macro! Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-14glx/tests: Add unit tests for the GLX part of GLX_MESA_query_rendererIan Romanick3-1/+449
These tests primarilly ensure that the functions added by this extension don't abuse other interfaces (e.g., glx_screen::query_renderer_integer) when provided bad data. These tests helped me find a couple small bugs in the initial implementation. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-14glx/tests: Add GetGLXScreenConfigs_called flagIan Romanick1-0/+4
Tests for the GLX_MESA_query_context extension will use this flag. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-14docs: Import extension spec for GLX_MESA_query_rendererIan Romanick1-0/+381
The enumerated values are currently allocated from Intel's range. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-14glx/dri2: Add DRI2 support for GLX_MESA_query_rendererIan Romanick5-1/+119
The new functions for this extension were added to a separate file (dri2_query_renderer.c) to facilitate unit testing. I tried putting them in dri2_glx.c, and it resulting in an unending chain of dependencies. It was the proverbial threading hanging from a sweater. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-14glx/dri2: Pull some internal structures out to a separate header fileIan Romanick2-20/+52
This structures will be accessed by internal functions that will be added in a file separate from dri2_glx.c. The new code will be added to a new file to facilitate unit testing. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-14glx/tests: Silence warnings after adding fields to glx_screen_vtableIan Romanick1-2/+6
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-14glx: Add functions and GLX plumbing for GLX_MESA_query_rendererIan Romanick4-1/+186
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-14glx: Add GLX_MESA_query_rendererIan Romanick1-1/+26
THESE ARE JUST PLACEHOLDER VALUES. DO NOT SHIP!!! Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-14glx: Add extension tracking GLX_MESA_query_rendererIan Romanick2-0/+2
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-14i965: Wire up initial support for DRI_RENDERER_QUERY extensionIan Romanick1-0/+81
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-14i915: Wire up initial support for DRI_RENDERER_QUERY extensionIan Romanick1-0/+79
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-14dri: Add function to implement queries common to all Mesa driversIan Romanick2-0/+65
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-14i965: Refactor the renderer string creation out of intelGetStringIan Romanick2-13/+23
This will soon be used in intel_screen.c from a function that doesn't have a gl_context. v2: Delete local variables that are now unused. This matches v1 of the changes to the i915 driver. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-14i915: Refactor the renderer string creation out of intelGetStringIan Romanick2-13/+23
This will soon be used in intel_screen.c from a function that doesn't have a gl_context. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-14i965: Refactor the vendor string out of intelGetStringIan Romanick2-2/+5
This will soon be used in intel_screen.c from a function that doesn't have a gl_context. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-14i915: Refactor the vendor string out of intelGetStringIan Romanick2-2/+4
This will soon be used in intel_screen.c from a function that doesn't have a gl_context. v2: Remove spurious break after return. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-14dri: Add interface definition for DRI_RENDERER_QUERY extensionIan Romanick1-0/+29
This will be used to let apps query hardware and driver limits before creating a GL context. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-14mesa: Add missing switch break in invalidate_framebuffer_storage()Constantin Baranov1-0/+1
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70411 Cc: "9.2" <mesa-stable@lists.freedesktop.org> Reviewed-by: Brian Paul <brianp@vmware.com>
2013-10-13st/vdpau: add format conversions for GetBitsYCbCrGrigori Goronzy1-8/+117
Add simple plain C routines for NV12<->YV12 and YUYV<->UYVY conversions. The NV12->YV12 conversion is commonly used, for instance by VLC. Reviewed-by: Christian König <christian.koenig@amd.com>
2013-10-13radeon: use staging for mapping linear texturesGrigori Goronzy1-0/+6
Textures that likely reside in VRAM, are mapped for reading and don't require direct mapping should be staged into GTT, to avoid bad performance. This fixes readback performance of VDPAU surfaces. Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2013-10-13radeon/uvd: use PIPE_BIND_LINEAR for video surfacesGrigori Goronzy2-7/+7
This new bind flag forces linear storage, but does not have other side effects like R600_RESOURCE_FLAG_TRANSFER. Reviewed-by: Christian König <christian.koenig@amd.com>
2013-10-13radeonsi: Allow Sinking pass to move preloaded const/res/samplVincent Lejeune2-5/+28
This fixes a crash in Unigine Heaven 3.0, and probably in some others apps.
2013-10-13radeonsi: pass alpha_ref value to PS in the user sgprVadim Girlin3-25/+29
Currently it's hardcoded in the shader, so every change requires compilation of the shader variant, killing the performance in Serious Sam 3 and probably other apps. This patch passes alpha_ref in the user sgpr and removes it from the shader key. Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-10-13r600g: fix tgsi_op2_s with trans-only instructionsVadim Girlin1-5/+31
This fixes the issue when dst and src is the same reg and operation on one channel overwrites the source for other channels, e.g.: UMUL TEMP[2].xyz, TEMP[0].xyzz, TEMP[2].xxxx In this example the result of the operation on channel x is written in TEMP[2].x and then used as a second source operand for channels y and z instead of original value in TEMP[2].x. This patch stores the results in temp reg and moves them to dst after performing operation on all channels. Fixes https://bugs.freedesktop.org/show_bug.cgi?id=70327 Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2013-10-13i965: Merge intel_context.h into brw_context.h.Kenneth Graunke2-172/+120
v2: Keep the random 32-bit only version of memcpy, since Ian says I can't delete it without data proving it isn't useful. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-13i965: Delete our copy of likely/unlikely macros.Kenneth Graunke1-10/+0
brw_context.h includes imports.h which includes compiler.h which already defines these. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-13mesa: Move U_FIXED/S_FIXED macros from i965 to macros.h.Kenneth Graunke3-39/+22
These make it easy to convert a floating point value to a fixed point numbers. The second parameter is the number of bits used for the fractional part of the number. It looks like core Mesa has similar functions already, but none that allows an arbitrary number of fractional bits. The more generic version is probably useful to everyone. r600g apparently has an identical copy of the S_FIXED macro, but doesn't include this file. I'm not sure what to do about that, so I'm just going to leave it for now. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-13mesa: Move ROUND_DOWN_TO() macro from i915/i965 to macros.h.Kenneth Graunke2-13/+12
This seems generally useful, so it may as well live in core Mesa. In fact, the comment for ALIGN() in macros.h actually says to "see also" ROUND_DOWN_TO, which...was in a driver somewhere. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-13i965: Move need_workaround_flush = true to intel_batchbuffer_init.Kenneth Graunke2-2/+2
intel_batchbuffer_init() sets up initial batchbuffer state; it seems like a reasonable place to initialize this flag. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-13i965: Move DriverFlag initialization to brw_init_state().Kenneth Graunke2-4/+5
Configuring which dirty flags we want sounds like a job for brw_init_state(). Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-13i965: Merge intelInitContext into brwCreateContext.Kenneth Graunke2-83/+43
The split here was completely arbitrary. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-13i965: Move viewport driver hook setup to brw_init_driver_functions.Kenneth Graunke1-12/+12
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-13i965: Make brwInitFunctions take brw_context rather than intel_screen.Kenneth Graunke1-6/+6
It actually just wants generation checking, and brw->gen is the usual way of doing that. In the future, we'll also want to check brw->hw_ctx, which isn't available from the screen. While we're changing the function signature, convert from camel case to our usual naming conventions. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-13i965: Merge intelInitFunctions() and brwInitFunctions().Kenneth Graunke1-10/+3
They do exactly the same thing. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-13i965: Merge intel_context.c into brw_context.c.Kenneth Graunke3-730/+685
There's no point in having two files for context functions. This patch moves the code from intel_context.c into brw_context.c unmodified (other than whitespace fixes). Right now, this looks silly; future patches will merge functions and tidy things up. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-13i965: Move memset of TextureFormatSupported to brw_init_surface_formats.Kenneth Graunke2-3/+2
brw_init_surface_formats already sets entries in TextureFormatsSupported to true; it may as well take care of initializing it to false too. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-13i965: Remove has_aa_line_parameters.Kenneth Graunke3-3/+5
This flag is only used in one place, and is only set on one platform. Just check for original Gen4 in the relevant function. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-13i965: Move state setup from brwCreateContext to brw_init_state().Kenneth Graunke2-8/+8
This seems like a better place for it, and helps clean up brwCreateContext (which is full of a lot of random stuff). Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-13i965: Remove the brw_context::emit_state_always flag.Kenneth Graunke3-5/+2
This was always set to false, and is only used for debugging. To enable it, simply change the if (0) block and recompile. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-13i965: Move hardware feature flags to brw_device_info.Kenneth Graunke3-4/+18
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-13i965: Move device quirks to brw_device_info.Kenneth Graunke3-8/+27
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-13i965: Move hardware limits to brw_device_info.Kenneth Graunke3-83/+117
Since each kind of device has its own brw_device_info structure, we can simply store the URB and thread limits there. This eliminates all the large if-ladders, and simplifies the context initialization code quite a bit. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-13i965: Replace some intel_screen fields with brw_device_info references.Kenneth Graunke4-62/+22
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-13i965: Delete the INTEL_SEPARATE_STENCIL override.Kenneth Graunke1-27/+0
This option was useful during initial development, but it's been ages since I've heard of anyone using it. Plus, Gen7+ mandates separate stencil, so it was really only useful on Sandybridge anyway. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-13i965: Add a new brw_device_info structure.Kenneth Graunke6-0/+150
The idea is that struct brw_device_info should store statically-known information about hardware features. Using the new family name in the PCI ID table, we can easily grab the right structure. This is basically the equivalent of intel_device_info in the kernel. This patch also makes the new structure available from intel_screen, but nothing uses it. Right now, it looks very redundant with existing fields, but that will change. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-13i965: Add the family name to the PCI ID table.Kenneth Graunke3-95/+95
I removed this a while ago, since we never used it, but I'm finally resurrecting the idea in the next commits. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-13i965: Remove #define name from PCI ID table.Kenneth Graunke3-95/+95
Nothing uses the #define name, and it's not terribly useful - the numerical ID serves the same purpose. The only thing we could really do with it is generate slightly prettier preprocessed code. But who looks at that? Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-13i965: Pull most driconf option handling into a centralized function.Kenneth Graunke2-47/+61
Using a helper function clarifies the context initialization code. I would've liked to completely centralize it, but moving the optionCache code from intelInitExtensions into here would've required setting flags in the context, which seems like a waste. v2: Rebase for the introduction of disable_derivative_optimization. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-13i965: Move a bunch of code from intelInitContext to brwCreateContext.Kenneth Graunke2-50/+44
Now that intelInitContext isn't shared between i915 and i965, the split is fairly arbitrary. This patch moves a bunch of the basic context creation and generation checking code up to the top-level function (and slightly earlier). More will follow. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>