Commit Graph

71 Commits

Author SHA1 Message Date
Eric Anholt
3e43adef95 i965: Add support for rendering to depthbuffer mipmap levels > 0.
Fixes
GL_ARB_depth_texture/fbo-clear-formats
GL_EXT_packed_depth_stencil/fbo-clear-formats
2011-05-18 13:57:18 -07:00
Chris Wilson
f627d429bd intel: Add some defense against bo allocation failure
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-03-07 10:53:00 +00:00
Chris Wilson
8d68a90e22 intel: use pwrite for batch
It's faster. Not only is the memcpy more efficiently performed in the
kernel (making up for the system call overhead), but by not using mmap
we remove the greater overhead of tracking the vma of every batch.

And it means we can read back from the batch buffer without incurring
the cost of a uncached read through the GTT.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:35 +00: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
Chris Wilson
85cfe32180 intel: Check for region allocation failure.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-08-05 08:38:55 +01:00
Eric Anholt
34474fa411 intel: Change dri_bo_* to drm_intel_bo* to consistently use new API.
The slightly less mechanical change of converting the emit_reloc calls
will follow.
2010-06-08 13:42:02 -07:00
Kristian Høgsberg
c4775a27e3 intel: Drop intelFlush()
Now that intel_flush() deosn't use the needs_mi_flush argument, we can
finally drop one of the two flush functions.
2010-05-10 17:48:11 -04:00
Eric Anholt
e1e48ea15c intel: Respect src pitch in _mesa_copy_rect().
If a non-zero src_y was used, this would break piglit
depth-level-clamp.
2010-03-17 11:24:01 -07:00
Eric Anholt
da011faf48 intel: Rely on allocated region pitch for the miptree pitch.
Bug #26966: 945 miptree pitch disagreement with libdrm.
2010-03-17 11:23:43 -07:00
Eric Anholt
32f143b432 intel: Remove extra tiling setting after allocating a tiled region. 2010-03-17 11:12:36 -07:00
Eric Anholt
a589da14de i965: Fix inversion for glCopyPixels to/from FBOs.
fixes piglit fbo-copypix.
2010-03-16 13:18:54 -07: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
179d2c0e0b intel: Use drm_intel_bo_alloc_tiled for region allocs.
This moves the logic for how to align pitches, heights, and sizes of
objects to one central location.  Fixes rendering with texture tiling
on i915.  Note that current libdrm is required for the change for
I915_TILING_NONE pitch alignment.
2010-03-03 11:33:37 -08:00
Kristian Høgsberg
0aa6105711 intel: Include main/hash.h using "" instead of <> 2010-02-18 07:49:55 -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
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
fa43956b5c i915: Remove left-over drmUnmap() 2010-02-11 16:34:11 -05:00
Eric Anholt
f20e83210e intel: Set the region's tiling to none when attaching a PBO to a region.
Note that when detaching the PBO from the region and making a new BO
for the region, we don't make it tiled even if the region originally
was.

Fixes piglit pbo-teximage-tiling.
2010-01-28 10:55:25 -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
Kristian Høgsberg
f55d0920cd intel: Drop DRI1 static regions 2010-01-04 11:48:01 -05:00
Kristian Høgsberg
01dc463e5d intel: Drop LOCK/UNLOCK_HARDWARE() 2010-01-04 11:48:01 -05: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
Eric Anholt
caf3038123 Make a convenient int for what chipset generation we're on.
gen2/3/4 are easier to say than "8xx, 915-945/g33/pineview, 965/g45/misc",
and compares on generation are often easier than stringing together a bunch
of chipset checks.
2009-11-06 11:37:31 -08:00
Brian Paul
0c309bb494 Merge branch 'mesa_7_5_branch' into mesa_7_6_branch
Conflicts:

	Makefile
	configs/default
	progs/glsl/Makefile
	src/gallium/auxiliary/util/u_simple_shaders.c
	src/gallium/state_trackers/glx/xlib/xm_api.c
	src/mesa/drivers/dri/i965/brw_draw_upload.c
	src/mesa/drivers/dri/i965/brw_vs_emit.c
	src/mesa/drivers/dri/intel/intel_context.h
	src/mesa/drivers/dri/intel/intel_pixel.c
	src/mesa/drivers/dri/intel/intel_pixel_read.c
	src/mesa/main/texenvprogram.c
	src/mesa/main/version.h
2009-09-09 08:33:39 -06:00
Eric Anholt
945d34e88a intel: Align untiled region height to 2 according to 965 docs.
This may or may not be required pre-965, but it doesn't seem unlikely, and
I'd rather be safe.
(cherry picked from commit b053474378)
2009-09-04 14:12:36 -07:00
Eric Anholt
b053474378 intel: Align untiled region height to 2 according to 965 docs.
This may or may not be required pre-965, but it doesn't seem unlikely, and
I'd rather be safe.
2009-08-19 09:19:06 -07:00
Eric Anholt
ceb8afcca5 intel: Align region height as required for tiled regions.
Otherwise, we would address beyond the end of our buffers.  Fixes reliable
GPU segfault with texture_tiling=true and oglconform shadow.c.

Bug #22406.
2009-08-07 18:33:08 -07:00
Brian Paul
6e0be1cc34 intel: move blit call out of assert() 2009-08-07 09:50:38 -06:00
Eric Anholt
ae1bfb6427 intel: Flush when mapping buffer objects so writes don't get reordered.
While GEM covers this for execution it knows about, it doesn't know about
the batchbuffer we're preparing.  Fixes piglit vbo-map-remap.c testcase.
2009-07-02 18:53:56 -07:00
Eric Anholt
3927874d9c intel: Make LOCK_HARDWARE recursive to avoid hand-rolling recursiveness. 2009-06-29 10:33:50 -07:00
Eric Anholt
8f81a6468f intel: Avoid trying to do blits to Y tiled regions.
This is somewhat nasty, but we need to do Y-tiled depth for FBO support.
May help with corruption and hangs since enabling texture tiling, and
since switching depth textures to Y tiled.

Fixes piglit depthtex.c on 965.
2009-06-23 19:31:11 -07:00
Eric Anholt
246d59c29e intel: Fix some potential writes to zero-copy PBOs when used as regions.
I was in the midst of fixing some blitting-with-Y-tiled issues when I
noticed this.  Hopefully PBO usage will be a little more robust, as a
result.
2009-06-23 19:31:11 -07:00
Eric Anholt
6a49473ab5 intel: Remove long-unused intel_region_fill and intelEmitFillBlit. 2009-06-23 19:31:10 -07:00
Eric Anholt
3b08a43f32 intel: Don't map regions with drm_intel_gem_bo_map_gtt() unless they're tiled.
This fixes a regression in region read performance that came in with the
texture tiling changes.  Ideally we'd have an access flag coming in so we
could also use bo_map_gtt for writing, like we do for buffer objects.

Bug #22190
2009-06-19 17:25:20 -07:00
Chia-I Wu
cca30245bd intel: Do not access pbo's buffer directly when attaching.
pbo might be system buffer based or attached to another region.  Call
intel_bufferobj_buffer to make sure pbo has a buffer of its own.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-06-19 16:43:45 -07:00
Chia-I Wu
ed91389618 intel: Data are copied in the wrong direction when breaking COW tie.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-06-19 16:43:45 -07:00
Eric Anholt
bd10f0e84f i965: Fix tiling for FBO depth attachments by making DEPTH_COMPONENT Y tiled.
This may hurt if miptree relayout occurs, since we can't blit Y tiled
objects.  But it corrects depth tests on FBOs using textures.
2009-06-17 20:19:19 -07:00
Eric Anholt
2d57e96408 intel: Fix intel_region_unmap to do unmap, not map.
Thanks to Shuang He for catching this.
2009-06-09 15:21:16 -07:00
Eric Anholt
1ba96651e1 intel: Add support for tiled textures.
This is about a 30% performance win in OA with high settings on my GM45,
and experiments with 915GM indicate that it'll be around a 20% win there.
Currently, 915-class hardware is seriously hurt by the fact that we use
fence regs to control the tiling even for 3D instructions that could live
without them, so we spend a bunch of time waiting on previous rendering in
order to pull fences off.  Thus, the texture_tiling driconf option defaults
off there for now.
2009-06-04 14:00:43 +00:00
Robert Ellison
1d11220771 i965: improve debug logging
Looking for memory leaks that were causing crashes in my environment
in a situation where valgrind would not work, I ended up improving
the i965 debug traces so I could better see where the memory was
being allocated and where it was going, in the regions and miptrees
code, and in the state caches.  These traces were specific enough
that external scripts could determine what elements were not being
released, and where the memory leaks were.

I also ended up creating my own backtrace code in intel_regions.c,
to determine exactly where regions were being allocated and for what,
since valgrind wasn't working.  Because it was useful, I left it in,
but disabled and compiled out.  It can be activated by changing a flag
at the top of the file.
2009-05-08 16:57:08 -06:00
Brian Paul
ecdf3ce436 i965: add missing init for region->width
This doesn't seem to really effect anything but seeing width=0 in drawing
regions was confusing.
2009-02-26 18:48:35 -07:00
Eric Anholt
40dd024be6 intel: tell libdrm whether we want a cpu-ready or gpu-ready BO for regions.
This lets us avoid allocing new buffers for renderbuffers, finalized miptrees,
and PBO-uploaded textures when there's an unreferenced but still active one
cached, while also avoiding CPU waits for batchbuffers and CPU-uploaded
textures.  The size of BOs allocated for a desktop running current GL
cairogears on i915 is cut in half with this.

Note that this means we require libdrm 2.4.5.
2009-02-21 10:53:41 -08:00
Brian Paul
7f0b6a7796 intel: more debug info 2009-01-30 16:03:32 -07:00
Dave Airlie
b359350017 Remove third buffer support from Mesa.
This is part of the deprecated pageflipping infrastructure.
2008-12-23 15:01:53 -08:00
Eric Anholt
dd17cd600a intel: Use dri_bo_get_tiling to get tiling mode of buffers we get from names.
Previously, we were trying to pass a name to the GEM GET_TILING_IOCTL,
which needs a handle, and failing.  None of our buffers were tiled yet, but
they will be at some point with DRI2 and UXA.
2008-10-27 11:53:06 -07:00
Eric Anholt
7d99ddcb2b intel: Fix a number of memory leaks on context destroy. 2008-09-26 15:39:20 -07:00
Eric Anholt
8db761409d intel: Add a width field to regions, and use it for making miptrees in TFP.
Otherwise, we would use the pitch as width of the texture, and compiz would
render the pitch padding on the right hand side.
2008-09-12 15:48:13 -07:00
Eric Anholt
3628185f56 intel: track bufmgr move to libdrm_intel and bufmgr_fake irq emit/wait change. 2008-09-10 13:59:45 -07:00