Commit Graph

130 Commits

Author SHA1 Message Date
Kristian Høgsberg
d7322c9d42 intel: Lookup requested renderbuffer in intel_create_image_from_renderbuffer
Previously we'd use the current renderbuffer.
2010-02-26 14:52:14 -05:00
Kristian Høgsberg
c26247100b intel: Implement DRI image extension 2010-02-24 14:28:42 -05:00
Kristian Høgsberg
d449627829 intel: Implement the DRI2 invalidate function properly
This uses a stamp mechanisms to mark the DRI drawable as invalid.
Instead of immediately updating the buffers we just bump the drawable
stamp and call out to DRI2GetBuffers "later".

"Later" used to be at LOCK_HARDWARE time, and this patch brings back
callouts at the points where we used to call LOCK_HARDWARE.  A new function,
intel_prepare_render(), is called where we used to call LOCK_HARDWARE,
and if the buffers are invalid, we call out to DRI2GetBuffers there.

This lets us invalidate buffers only when notified instead of on
every glViewport() call.  If the loader calls the DRI invalidate
entrypoint, we disable viewport triggered buffer invalidation.

Additionally, we can clean up the old viewport mechanism a bit,
since we can just invalidate the buffers and not worry about
reentrancy and whatnot.
2010-02-17 21:53:16 -05:00
Francisco Jerez
61d26bc82e dri2: Event driven buffer validation.
When a buffer invalidation event is received from the X server, the
"invalidate" hook of the DRI2 flush extension is executed: A generic
implementation (dri2InvalidateDrawable) is provided that just bumps
the "pStamp" sequence number in __DRIdrawableRec.

For old servers not supporting buffer invalidation events, the
invalidate hook will be called before flushing the fake front/back
buffer (that's typically once per frame -- not a lot worse than the
situation we were in before).

No effort has been made on preserving backwards compatibility with
version 2 of the flush extension, but I think it's acceptable because
AFAIK no released stack is making use of it.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2010-02-16 10:38:50 -05:00
Kristian Høgsberg
2d99588b35 intel: Track named regions and make sure we only have one region per named bo 2010-02-12 16:30:39 -05:00
Kristian Høgsberg
cc57baff5f i915: Remove always-true irq_active struct intel_screen field 2010-02-11 16:56:44 -05:00
Kristian Høgsberg
c9b0f04b1f i915: Remove a few DRI1 era struct intel_screen fields 2010-02-11 16:54:20 -05:00
Kristian Høgsberg
5777dee02c i915: Drop intelScreenPrivate typedef and just call it struct intel_screen 2010-02-11 16:49:26 -05:00
Ian Romanick
6bd9da01ea intel: Don't expose GLX_SWAP_EXCHANGE_OML
We can't always guarantee that the swap will happen by exchange, so we
can't expose this mode.  GLX_SWAP_UNDEFINED_OML already covers the
case where the swap *might be* by exchange.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2010-02-10 10:50:28 -08:00
Ian Romanick
bb65a1d009 intel: Expose a minimal number of configs with accumulation buffer
Expose one config per color depth that includes accumulation buffer.
We could probably expose only one config with accumulation buffer, but
that would require figuring out the actual color depth.  This is
easier and only exposes 2 useless configs.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2010-02-10 10:50:28 -08:00
Ian Romanick
3cce4a1e10 dri: Allow selective generation of accum. buffer configs
Modify the interface to driCreateConfigs allowing drivers to not
expose configs with an accumuation buffer.  All of the drivers calling
function have been updated to pass true for the accumulation
selector.  This maintains the current behavior.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Corbin Simpson <MostAwesomeDude@gmail.com>
2010-02-10 10:50:28 -08:00
Ian Romanick
73e24cd5a7 intel: Stop exposing useless 24 depth/0 stencil configs
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2010-02-10 10:50:28 -08:00
Ian Romanick
6d91f9a024 intel: Remove redundant init of depth_bits / stencil_bits in intelInitScreen2
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2010-02-10 10:50:28 -08:00
Ian Romanick
066f45c7a1 intel: Update comment in intelInitScreen2 to noting DRI2 protocol issues
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2010-02-10 10:50:28 -08:00
Francisco Jerez
2ec50d256d mesa: Factor out the fb initialization details from _mesa_new_framebuffer.
This should make things easier for drivers wanting to work with a
"subclass" of gl_framebuffer.

The complementary "_mesa_initialize_framebuffer" function is now
called "_mesa_initialize_window_framebuffer" for the sake of
symmetry.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-02-03 08:30:09 -07:00
Vinson Lee
c6e26d76c7 intel: Remove unnecessary headers. 2010-01-30 19:11:31 -08:00
Jesse Barnes
06d228d8b9 intel: make sure we update the renderbuffers after a swap
Now that LOCK_HARDWARE is gone, we don't have a convenient place to
update the renderbuffers everywhere we need them.  So grab new buffers
when we invalidate the old ones until we optimize things further.
2010-01-26 22:18:27 +02:00
Eric Anholt
7aed23c362 intel: Don't do client-side frame throttling with DRI2 SwapBuffers.
The server side does the throttling on our behalf now by putting the
client to sleep, so we don't need our previous hacks for limiting the
number of outstanding frames.  Same effect as
7d4e674b21.
2010-01-25 22:57:33 -08:00
Eric Anholt
c7fc9bfb22 Revert "intel: Use the new DRI2 flush invalidate entrypoint to signal frame done."
This reverts commit 7d4e674b21.  It broke
throttling in the non-new-DRI2 case.
2010-01-25 22:57:33 -08:00
Brian Paul
9b22427911 Merge branch 'mesa_7_7_branch'
Conflicts:

	src/mesa/drivers/dri/intel/intel_screen.c
	src/mesa/drivers/dri/intel/intel_swapbuffers.c
	src/mesa/drivers/dri/r300/r300_emit.c
	src/mesa/drivers/dri/r300/r300_ioctl.c
	src/mesa/drivers/dri/r300/r300_tex.c
	src/mesa/drivers/dri/r300/r300_texstate.c
2010-01-25 14:46:17 -07:00
Vinson Lee
fb6bff3712 intel: Remove unnecessary headers. 2010-01-23 14:33:29 -08:00
Eric Anholt
7d4e674b21 intel: Use the new DRI2 flush invalidate entrypoint to signal frame done.
Previously for frame throttling we would wait on the first batch after
a swap before emitting another swap, because we had no hook after a
swap was emitted.  This meant that if an app managed to squeeze
everything it for a frame had into one batch, it would lock-step with
the GPU.  With the swapbuffers changes, we now have the entrypoint we
want.

This takes the WoW intro screen from 25% GPU idle and visibly jerky to
4-5% GPU idle and rather smooth.  Other apps such as OpenArena have
run into this problem as well.
2010-01-19 11:07:51 -08:00
Jesse Barnes
c6ef705e41 Merge branch 'master' of ssh://people.freedesktop.org/~jbarnes/mesa
Conflicts due to DRI1 removal:
	src/mesa/drivers/dri/intel/intel_context.c
	src/mesa/drivers/dri/intel/intel_screen.c
2010-01-11 15:23:29 -05:00
Kristian Høgsberg
7c50d29f7c intel/DRI2: add DRI2flushExtension support with invalidate hook
Needed to support the SwapBuffers code properly.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2010-01-08 12:40:58 -05:00
Kristian Høgsberg
51362a75a7 intel: intelScreenContext() is no longer used 2010-01-04 11:48:03 -05:00
Kristian Høgsberg
5a0b60aa1b intel: Remove remaining dri2.enabled tests 2010-01-04 11:48:02 -05:00
Kristian Høgsberg
d282128ff6 intel: Remove struct intel_framebuffer
With the vsync fields no longer relevant and by refactoring the code
to no longer use color_rb[0-1] we can just use struct gl_framebuffer
directly.
2010-01-04 11:48:02 -05:00
Kristian Høgsberg
a6e1d3edac intel: Remove client-side vblank code 2010-01-04 11:48:02 -05:00
Kristian Høgsberg
f55d0920cd intel: Drop DRI1 static regions 2010-01-04 11:48:01 -05:00
Kristian Høgsberg
3566bc7584 intel: Drop DRI1 SwapBuffer implementation 2010-01-04 11:48:01 -05:00
Kristian Høgsberg
4611f08c07 intel: Drop DRI1 CopySubBuffer implementation 2010-01-04 11:48:01 -05:00
Kristian Høgsberg
48c0ff1424 intel: Drop DRI1 support
The DDX driver stopped supporting DRI1 so we're dropping support for
that from the DRI driver too.
2010-01-04 11:48:00 -05:00
Kristian Høgsberg
39a0e4e7de Push __driDriverExtensions out of dri_util.c and into the drivers
This lets the individual drivers select which extensions to advertise.
Specifically, most drivers (tdfx, sis, savage etc) don't support DRI2
but the shared extension list in dri_util.c does list the DRI2 extension.

Pushing the list into the drivers, lets us avoid listing the DRI2
extension for drivers that don't support it.
2010-01-04 11:48:00 -05:00
Kristian Høgsberg
d61f07318c Remove leftover __DRI{screen,drawable,context}Private references
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.
2010-01-04 11:48:00 -05:00
Eric Anholt
1e4677a61f intel: Remove dead fthrottle_mode option. We only do IRQ waits.
Noticed by clang.
2009-12-28 18:51:18 -08:00
Eric Anholt
5727147f89 intel: Remove unused stored values reported by clang. 2009-12-22 14:20:26 -08:00
Eric Anholt
827ba44f6e intel: Remove non-GEM support.
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-11-19 11:47:22 +01:00
Brian Paul
409469fb70 intel: fix up some XRGB breakage
We weren't choosing the right XRGB span functions for reading the
framebuffer.  XRGB formats still aren't turned on yet though.
2009-10-30 09:13:04 -06:00
Brian Paul
4a253431ab intel: update intel_create_renderbuffer(format), add XRGB support
Pass a gl_format to intel_create_renderbuffer() instead of GLenum.
Add cases for MESA_FORMAT_XRGB8888 textures and renderbuffers.
However, we don't yet create any renderbuffers or textures with that
format.  It seems the default alpha value is zero instead of one.
Need to investigate that first.
2009-10-29 19:12:50 -06:00
Chia-I Wu
17ef1f6074 mesa: Enable remap table in core.
This enables the remap table in core.  driInitExtensions is adapted to
use the remap table.  All uses of extension_helper.h are replaced by
remap_helper.h.  The chicken-egg problem of the DRI drivers is also
solved.

It is now also possible to pass NULL extensions to driInitExtensions.
It will cause driInitExtensions to map all known functions.  This
functionality is used by software drivers and EGL_i915.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-10-23 09:10:04 -06:00
Eric Anholt
81aa5d717b i915: Add stub ARB_occlusion_query support under a driconf debug option.
This is useful for enabling our GLSL testcases using the 2.0 entrypoints
even though we don't have full GL 2.0.
2009-10-01 14:54:15 -07:00
Eric Anholt
862a2a55b3 i915: Add optional support for ARB_fragment_shader under a driconf option.
Other vendors have enabled ARB_fragment_shader as part of OpenGL 2.0
enablement even on hardware like the 915 with no dynamic branching or
dFdx/dFdy support.  But for now we'll leave it disabled because we don't
do any flattening of ifs or loops, which is rather restrictive.

This support is not complete, and may be unstable depending on your shaders.
It passes 10/15 of the piglit glsl tests, but hangs on glean glsl1.
2009-10-01 14:52:44 -07:00
Eric Anholt
a962c07cc3 Revert "i965: Disable texture tiling by default."
This reverts commit b8e638d489.

Now that the known hangs and misrendering issues are fixed, I'm ready to
start encouraging it by default again.
2009-08-07 18:33:08 -07:00
Brian Paul
d2f6d6ce49 Merge branch 'mesa_7_5_branch'
Conflicts:

	Makefile
	configs/default
	docs/relnotes.html
	src/mesa/main/version.h
2009-07-28 08:58:25 -06:00
Brian Paul
3dbaf68bdc intel: Fix leak of DRI option info due to using the wrong free routine.
(cherry picked from commit 6d66f23c50)
2009-07-27 15:33:07 -06:00
Brian Paul
d2f56fe687 intel: Use _mesa_warning() to report GEM warnings 2009-07-27 14:35:18 -06:00
Eric Anholt
6d66f23c50 intel: Fix leak of DRI option info due to using the wrong free routine. 2009-07-02 14:07:10 -07:00
Eric Anholt
cb4ef34214 intel: Init num_fences to clean up valgrind warning.
Valgrind doesn't know that a successful getparam sets the target of the
pointer, so just set the value beforehand.
2009-07-02 14:07:09 -07:00
Brian Paul
39366ed995 intel: remove extra \n from warning string
(cherry picked from commit 42e9bde0fa)
2009-06-17 12:55:26 -07:00
Robert Ellison
56235ae504 i965: send all warnings through _mesa_warning()
One warning message:
   drm_i915_getparam: -22

was still being sent to fprintf().  This causes all Piglit tests to fail,
even with MESA_DEBUG=0.

Using _mesa_warning() to emit the message allows the general Mesa controls
for messages like this to be applied.
(cherry picked from commit bc3270e99f)
2009-06-17 12:55:26 -07:00