aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/r200/r200_context.h
Commit message (Collapse)AuthorAgeFilesLines
* Refactor and fix core vblank supportJesse Barnes2007-10-291-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Consolidate support for synchronizing to and retrieving vblank counters. Also fix the core vblank code to return monotonic MSC counters, which are required by some GLX extensions. Adding support for multiple pipes to a low level driver is fairly easy, the Intel 965 driver provides simple example code (see intel_buffers.c:intelWindowMoved()). The new code bumps the media stream counter extension version to 2 and adds a new getDrawableMSC callback. This callback takes a drawablePrivate pointer, which is used to calculate the MSC value seen by clients based on the actual vblank counter(s) returned from the kernel. The new drawable private fields are as follows: - vblSeq - used for tracking vblank counts for buffer swapping - vblFlags - flags (e.g. current pipe), updated by low level driver - msc_base - MSC counter from the last time the current pipe changed - vblank_base - kernel DRM vblank counter from the last time the pipe changed Using the above variables, the core vblank code (in vblank.c) can calculate a monotonic MSC value. The low level DRI drivers are responsible for updating the current pipe (by setting VBLANK_FLAG_SECONDARY for example in vblFlags) along with msc_base and vblank_base whenever the pipe associated with a given drawable changes (again, see intelWindowMoved for an example of this). Drivers should fill in the GetDrawableMSC DriverAPIRec field to point to driDrawableGetMSC32 and add code for pipe switching as outlined above to fully support the new scheme.
* r200: Implement SetTexOffset hook.Chris Rankin2007-09-291-0/+1
| | | | Implementation guidance by Michel Dänzer, final testing by Timo Aaltonen.
* remove CVS/XFree86 keywordsChristoff Brill2007-05-171-1/+0
|
* r200: simplify / unify input map handling for vp and fftnlRoland Scheidegger2007-02-091-10/+2
| | | | | | Use the same input map handling for fftnl and vertex programs. It doesn't enable any new functionality (should make it easy to support per-vertex materials though), but the code is much cleaner.
* remove now unused vtxfmt stuff from radeon/r200 header filesRoland Scheidegger2007-02-031-124/+0
|
* submit vertex weights to make World of Warcraft maybe happy (bug 8250)Roland Scheidegger2006-12-141-0/+1
| | | | | | | submit the vertex weights to hw, which will enable broken vertex programs errorneously using them to work. Note however that this will only work if glWeight is used, there is no code in mesa at all to deal with weight vertex array (glWeightPointerARB).
* fix mixed conventional / generic vertex arrays which caused a wrong array ↵Roland Scheidegger2006-11-301-0/+2
| | | | order leading to very bogus rendering (for instance WoW intro screen mentioned in #8250).
* Remove use of GetBufferSize (depreciated).Jerome Glisse2006-11-151-0/+1
|
* enable generic arrays for r200 hw vertex programs by assigning unused color ↵Roland Scheidegger2006-11-031-2/+3
| | | | and texture inputs to them. Not widely tested yet. This should eliminate all fallbacks due to vertex programs, except writes to back facing colors, or when exceeding a hw limit (12 temps, 12 attribs etc.).
* fix (per-vertex) fog when using ARB_vp by incorporating fog factor ↵Roland Scheidegger2006-10-241-1/+5
| | | | computation into the vertex program (not yet fixed for swtnl). Simplify (and correct) the VTX_TCL_OUTPUT_VTXFMT handling when using vertex programs, turns out it's solely driven by the needs of the past-vertex stage of the pipeline, this should fix lockups with ill-specified applications using vertex programs (for instance applications enabling fog but not writing to fog coord output will now get (conformant) undefined results instead of lockups).
* implement ARB_point_parameters and ARB_point_sprite on r200. The code is ↵Roland Scheidegger2006-10-131-3/+24
| | | | nearly the same as outlined in bug #4707, except it disables perspective correction for point sprites to make them actually work. And, separate the state atom into two as the tcl parameters would overwrite vertex program parameters when active. Also implement the GL_VERTEX_PROGRAM_POINT_SIZE_ARB option to make vertex programs outputting a point size work correctly (untested). Smooth points will still always be size 1. While here, enable gouraud shading for fog when using fog coord.
* Minor r200 vertex program cleanups. Remove disabled leftovers from r300 ↵Roland Scheidegger2006-08-301-1/+1
| | | | vertex program code. Fix authors. Correct slightly wrong check to determine if ran out of temps. Simplify check to determine if ran out of max instructions. Correctly report used native temps. Always kick off program translation when ProgramStringNotify is called (otherwise the reported native resources used queried might be wrong).
* Some structure renaming. Prefix vertex/fragment-related structs withBrian Paul2006-07-201-1/+1
| | | | "gl_" to match other structs.
* check if radeon_drm.h from libdrm is new enough, otherwise print an error to ↵Roland Scheidegger2006-07-031-0/+4
| | | | make it easier to figure out why it won't compile...
* implement arb_vertex_program in hw for r200. Code contains still some hacks, ↵Roland Scheidegger2006-06-021-0/+42
| | | | generic attribs cause a fallback, but otherwise it seems to work quite well. Passes all glean vertProg1 tests with the exception of the degnerated LIT case (which is a hw limitation), as well as runs the r200 render path of doom3/quake4 (1.1 patch needed for quake4). The code is heavily borrowed from the r300 driver as vertex programs encoding is almost identical. arb_vertex_program is not yet announced by default and still needs to be enabled via driconf.
* preparation for r200 hw vertex programs. Increase R200_CMD_BUF_SZ to 16k ↵Roland Scheidegger2006-05-271-1/+1
| | | | instead of 8k (the reasons why it was exactly 8k are unclear). Add register defines, sanity code, fix potential issue with wrong statechange order when disabling fragment programs.
* More GLSL code:Michal Krol2006-04-111-1/+1
| | | | | | | | | | | | - use macros to access and modify render inputs bit-field; - un-alias generic vertex attributes for ARB vertex calls; - use MAX_VERTEX_PROGRAM_ATTRIBS (NV code) or MAX_VERTEX_ATTRIBS (ARB code) in place of VERT_ATTRIB_MAX; - define VERT_ATTRIB_GENERIC0..15 for un-aliased vertex attributes for ARB_vertex_shader; - fix generic attribute index range check in arbprogparse.c; - interface GLSL varyings between vertex and fragment shader; - use 64-bit optimised bitset (bitset.h) for render inputs;
* Dave Reveman's patch for GLX_MESA_copy_sub_buffer supportBrian Paul2006-03-311-0/+2
|
* fix missing *_STATECHANGE in *UpdateViewportOffset for radeon, r200 and r300 ↵Roland Scheidegger2006-03-281-0/+4
| | | | (reported by Jim Duchek). Fix some potential problems with strict-aliasing with r200 and radeon drivers in *UpdateViewportOffset, *PolygonOffset and *UpdateWindow functions (some compiler warnings about strict-aliasing remain in the codegen vertex code, and there may be more problems unnoticed by the compiler).
* First step of Radeon DRI unification:Eric Anholt2005-11-021-3/+3
| | | | | | | | | | | | - Makes all three drivers use the same screen structure and setup code, with a few ifdefs for the separate compilation to deal with symbols not being available to all drivers and the fact that we have no mechanism for dealing with different config options for different chip families in the same driver. These issues should be dealt with later. - Introduces IS_R[123]00_CLASS(radeonScreenPtr) macro for code for taking different paths depending on the general class of chipset. - Adds many new R300-class PCI IDs, though not all those listed in radeon_driver.c.
* fix potential bug when emitting elts with lots of componentsRoland Scheidegger2005-10-131-1/+2
|
* reverse accidentally commited part of last commit (makes it compile again...).Roland Scheidegger2005-10-051-0/+1
|
* enable point sizes larger than 1 (for aliased points only) by using the hw ↵Roland Scheidegger2005-10-051-1/+6
| | | | point sprite primitive.
* add complete support for ATI_fragment_shader for the r200. Most of the new ↵Roland Scheidegger2005-09-121-6/+34
| | | | code is in the new file r200_fragshader.c. Reverse engeneered by Dave Airlie and me
* Finish up some of the gl_renderbuffer work.Brian Paul2005-09-011-0/+6
| | | | | | | | Use driRenderbuffer's offset, pitch fields in the span routines. Remove the SetBuffer driver function. Consolidate the code for setting CTX_RB3D_COLOROFFSET and CTX_RB3D_COLORPITCH state in new radeonUpdateDrawBuffer() function. Old code is surrounded by #if 000 / #endif, temporarily.
* enable GL_ARB_texture_env_crossbar on r200, separate the enable bits for ↵Roland Scheidegger2005-08-311-2/+3
| | | | texture sampling and texture environment, optimize away texture sampling for units if the result is not used, always emit the env instructions in-order and try to eliminate GL_REPLACE env instructions.
* Fixes the glXGetProcAddress portion of the interface. Most of the functionsIan Romanick2005-07-261-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | that are currently obtained via glXGetProcAddress and all of the XF86DRI functions are replaced with a funciton table. This table will be passed to __driCreateNewScreen. One of the functions in the table is getProcAddress. This allows some loaders to expose functionality not in all loaders. This will be immediatly used for glxEnableExtension (formerly known to drivers as __glXScrEnableExtension). libGL (and in the future libglx) expose this function so that drivers can enable GLX extensions. libEGL should exposed eglEnableExtension to enable EGL extensions. The same function cannot be used for both because the extensions have different names and (possibly) different semantics. Drivers can optionally use one, both, or neither. The key parts are in the __DRIinterfaceMethodsRec structure in dri_interface.h. A pointer to one of these structures is passed into __driCreateNewScreen. Because of this, the version of the API is bumped to 20050725. Since the previous version(s) were never in a release, their existance is erased. I was actually a little surprised by how much code this cuts from the drivers. A lot of glXGetProcAddress calls disappear, and a lot of version checks go with them. Nice. The one thing I'm not sure of is removing __glXInitialize. For some reason that function was in the glXGetProcAddress table, but *nothing* in the Mesa tree used it. Did something with DRI conf. use this function? It seems odd...
* Correct the descriptions of the glBlend{Equation,Func} fallbacks in r128, andEric Anholt2005-05-311-8/+6
| | | | | remove those descriptions and the corresponding bits on r200, where they're no longer used.
* add support for user-configurable brilinear filtering on r200Roland Scheidegger2005-03-151-5/+9
|
* add texture micro and macro tiling to radeon/r200 driver. This can improve ↵Roland Scheidegger2005-02-101-0/+3
| | | | performance up to 15% in texture-intensive applications. Convert the driver to use the correct blit format and blit width instead of fixed blit format and blit width when uploading textures to make it work.
* Bug #2428: #ifdef GLX_DIRECT_RENDERING in DRI drivers is pointless.Adam Jackson2005-01-311-3/+0
|
* (Stephane Marchesin, me) add hyperz support to radeon and r200 drivers. Only ↵Roland Scheidegger2004-12-081-0/+3
| | | | fast z clear and z buffer compression are supported for now, hierarchical-z is not. Still problems with multiple apps and z/stencil readback, which is why hyperz is disabled per default. Also add the new point sprite packet drm 1.13 accepts to the sanity code.
* enable GL_EXT_fog_coord. Calculate fog factors and submit them instead of ↵Roland Scheidegger2004-11-031-0/+5
| | | | fog coords (it seems the chip cannot do fog factor computation when not using fragment depth as fog coord source). vtxfmt uses fallback for now (most code present but some magic would be needed if replaying vertices is necessary later on).
* Add code to support projective texturing and fix mixed enabling of textureEric Anholt2004-10-161-1/+1
| | | | | | | | | | | | | | | coordinate generation. Original code by Roland Schiedegger, with changes by myself. While here, ensure that the swtcl path does tnl_install_attrs enough when fog/specular are being (en/dis)abled. Notable effects: - projtex test works with TCL and is closer with swtcl (Bugzilla #1461) - 8/9 squares work in texgenmix instead of 3. - texcyl "reflect" mode works (GL_SPHERE_MAP is now a fallback -- unclear if the hardware can actually support it). - flickering in doom3 replaced by just plain darkness. - blocktube fixed (Bugzilla #984) - fixes stex3d
* OK, one more time. Simplify the state-backup system by just storing the fullEric Anholt2004-09-301-4/+5
| | | | | | | | | state in a ready-to-emit cmdbuf, which avoids the issue Nicolai Haehnle reported where the check() could return differently during backup-and-emit than it should have if it were called at the right time. Move the lit emission before most of the TCL state emission on r200, which fixes neverball issues. Tested with: r100/r200 with neverball, tuxracer, chromium, quake3, ipers
* The previous code would emit a full set of state during the first EmitState onEric Anholt2004-09-221-4/+5
| | | | | | | | | | | | | a new cmdbuf, to ensure that state wasn't lost across UNLOCK/LOCK pairs (in the case of context switching). This was rather inefficient. Instead, after flushing a cmdbuf, mark the state as needing to be saved on UNLOCK. Then, at the beginning of flushing a cmdbuf, if we actually have lost the context, go back and emit a new cmdbuf with the full set of state, before continuing with the cmdbuf flush. Also, remove the dirty/clean atom lists, since atoms are emitted in a fixed order these days, and go with a simpler single list. Provides a 14% improvement in ipers performance in my tests, along with other apps.
* Close some races with locking on R100 and R200 which could manifest as renderingEric Anholt2004-08-171-0/+2
| | | | | | | | | | | | | | | | | | | | errors on r100 and rendering errors and hangs on r200 (same for R100 without OLD_PACKETS). If a command buffer filled after some state (EmitState or a VBPNTR write) was emitted, the lock was grabbed, the buffer flushed, a new buffer prepared, and the lock dropped. Another client could come in, set its own state as part of rendering, and when the first client flushed the rendering commands depending on the previous state, it got the 2nd client's state. This is fixed by checking for enough space before beginning a set of state emits and rendering, and flushing the buffer first if so. This guarantees that the buffer won't wrap. Also, move the "lost_context = 1" from the end of cmdbuf flushing to UNLOCK_HARDWARE for clarity (at a minimum) that any time the lock is dropped, state may get overwritten. We don't have enough information at the point of the LOCK_HARDWARE to reset our state to the last UNLOCK_HARDWARE point in the case that we did lose our context, but saving the information to rebuild that state may be a useful optimization (ipers data suggests up to 5%).
* add support for more than 2 texture units (max 6, default 4). use hang ↵Roland Scheidegger2004-06-021-16/+24
| | | | workarounds only for r200, not derivatives.
* Replace drmHandle, drmContext, drmDrawable, drmMagic and related types withIan Romanick2004-06-021-1/+1
| | | | drm_handle_t, drm_context_t, drm_drawable_t, drm_magic_t.
* remove never finished verts path (r200_maos_vbtmp.h, r200_maos_verts.c) and ↵Roland Scheidegger2004-05-281-2/+0
| | | | unused R200_OLD_PACKET macro
* Add support for GL_EXT_blend_[func|equation]_separate. Fix ↵Roland Scheidegger2004-05-201-1/+6
| | | | GL_EXT_blend_color. Remove support for GL_EXT_blend_logic_op (cannot be supported together with blend_equation_separate unless a software fallback would be added).
* Added support for the 3rd texture coordinate for cubemaps and 3DIan Romanick2004-05-051-6/+19
| | | | | | textures. progs/demos/cubemap and progs/demos/stex3d seem to work correctly at all tcl_mode settings. x86 / SSE codegen is currently disabled.
* bring over build fixes from stable branchAlan Hourihane2004-04-261-1/+0
|
* Convert R200 driver to use the t_vertex interface.Ian Romanick2004-04-231-4/+36
|
* Adjustments to make everything use IOCTL/sarea defines in DRM insteadJon Smirl2004-03-111-8/+9
| | | | of glx/mini. removes glx/mini/drm.h glx/mini/sarea.h
* Fix attenuation hardware state handling, inspired by the R200 DDK referenceMichel Dänzer2004-01-231-3/+3
| | | | | driver (our r200 driver basically didn't do this at all, maybe got lost along the way?)
* Silence some compiler warnings.Ian Romanick2004-01-211-2/+2
|
* Before calling _mesa_create_context(), initialize a dd_function_table structBrian Paul2004-01-201-1/+1
| | | | | | | | | | by calling _mesa_init_driver_functions() and then plugging in the driver- specific functions. In particular, make sure ctx->Driver.NewTextureObject points to the appropriate driver function so that _all_ texture objects are augmented with the driver-specific data. Put in a bunch of assertions in the texture-related driver functions that texObj->DriverData is valid. Remove old dead code in near future.
* Roland Scheidegger's r200_changeemitorder.diff.Keith Whitwell2004-01-091-0/+1
|
* Updates to tnl_dd_dmatmp.hKeith Whitwell2003-12-111-6/+0
| | | | | | | | | | | | | | - Allocate vertices explicitly, rather than trying to talk about dma buffers. - Clean up the various Flush() operations. - Don't allow fallbacks any longer. Provide a support function to detect them ahead o ftime Updates to tnl_dd_vbtmp.h - Get rid of power-of-two vertex strides. Pack all vertices tightly. - Get texunit 2,3 emit working coorrectly. Other stuff: - Get rid of lingering Ubyte color support. - Fix a few compiler warnings.