Commit Graph

145 Commits

Author SHA1 Message Date
Kristian Høgsberg
9ec0b2a45e dri2: Make createImageFromName() take a __DRIscreen instead of __DRIcontext
We can't expect to have a context when this is called, and we don't need one
so just require a __DRIscreen instead.

Reported by Yu Dai <yu.dai@intel.com>
2010-09-22 15:08:22 -04:00
Kristian Høgsberg
f301932dba intel: Support EGL_MESA_image_drm 2010-08-25 09:17:48 -04:00
Kristian Høgsberg
9087ba1280 intel: Take an intel_screen pointer in intel_alloc_region_* functions 2010-08-25 09:17:48 -04:00
Eric Anholt
a58514cc9c i915: Enable ARB_fragment_shader by default.
Now that we have glsl2 with if flattening in place, most shaders will
just work.  Remaining failing shaders will mostly be due to loop
unrolling (in progress), some possible if flattening failures in
inlining functions (planning on fixing), and the register/instruction
count limits.

While the GLSL and GLSL-ES specs say that shaders shouldn't fail to
compile/link due to register/instruction limits, in practice we're not
the first vendor to expose GLSL on hardware with these limitations.
The benefit to application developers of providing a better language
for GPU programming is greater than the pain of having to handle
instruction limits (which they had to for ARB_fp on this hardware
anyway)
2010-08-17 16:39:17 -07:00
Kristian Høgsberg
e67c338b41 intel: Throttle after doing copyregion/swapbuffers round trip
Before we would throttle in the flush callback prior to round-tripping
to the server to do copyregion or swapbuffer.  Now, instead just note
that we need to throttle and do it in intel_prepare_render(), which
will be called after receiving the response from the server but before
we start rendering the next frame.  Even if the server also throttles
us in swapbuffer, this just makes the throttling a no-op when we hit
intel_prepare_render().  With that we can drop the
using_dri2_swapbuffers hack and just always throttle.
2010-05-20 11:39:28 -04:00
Kristian Høgsberg
0870e4a202 Merge branch 'gles2-2'
Conflicts:
	src/mesa/drivers/dri/common/dri_util.h
2010-05-02 10:17:07 -04:00
Kristian Høgsberg
5efee4d4e6 intel: Advertise GLES1/2 for i915+ when enabled 2010-04-28 14:05:22 -04:00
Kristian Høgsberg
4b69100bdc dri: Add DRI entrypoints to create a context for a given API 2010-04-28 14:05:21 -04:00
Kristian Høgsberg
a7a9a91d7b dri: Add DRI entrypoints to create a context for a given API 2010-04-28 14:05:21 -04:00
Jesse Barnes
234286c0f8 DRI2: add config query extension
Add a new DRI2 configuration query extension.  Allows for DRI2 client
code to query for common DRI2 configuration options.
2010-04-22 12:49:45 -07:00
Eric Anholt
800a4b202f intel: Remove more code for x8z24 visuals, since we only do s8z24. 2010-03-16 13:18:54 -07:00
Eric Anholt
a232cc59e3 intel: Remove support for the DRI1 TFP extension. 2010-03-05 15:23:30 -08:00
Eric Anholt
bb35000b4b intel: Remove non-kernel-exec-fencing support.
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-03-04 16:56:32 -08:00
Eric Anholt
8e7a8d6593 i915: Enable texture tiling by default.
This now passes piglit testcases, and shows performance improvements
on openarena.  Blit-heavy apps may see degradation, but the
expectation is that the common case of 3D rendering will see
significant wins.

This regresses gen-teximage on my 855, and no piglit tests on my 945.
2010-03-04 08:18:53 -08:00
Eric Anholt
06d1472ffa i915: Tell the kernel when we actually need fence registers on our BOs.
This improves tiled texture performance of OA on my 945 from 25.3fps
to 29.0fps, whereas untiled is 28.2fps, by avoiding stalls for fence
register changes.
2010-03-03 11:33:37 -08:00
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