Commit Graph

1832 Commits

Author SHA1 Message Date
Thomas Hellstrom e7843273fa winsys/svga: Update to vmwgfx kernel module 2.1
Introduces fence objecs and a size limit on query buffers.
The possibility to map the fifo from user-space is gone, and
replaced by an ioctl that reads the 3D capabilities.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecranz <jakob@vmware.com>
2011-09-29 20:24:57 +02:00
Marek Olšák a3cd2c6c9b winsys/radeon: remove redundant member radeon_bo::size
It's part of pb_buffer already.
2011-09-29 01:10:18 +02:00
Marek Olšák 798ebc91eb winsys/radeon: simplify updating GEM domains for relocations 2011-09-29 01:10:12 +02:00
Marek Olšák bfa51dfeac winsys/radeon: simplify passing GEM domains through to GEM_CREATE 2011-09-29 01:10:07 +02:00
Marek Olšák 4b1e7cf5d9 r600g: convert if (query->type) into switch statements 2011-09-29 01:07:30 +02:00
Marek Olšák 34f4bd8190 winsys/radeon: use the cache bufmgr for buffers with PIPE_BIND_CUSTOM
so that we don't abuse PIPE_BIND_VERTEX_BUFFER all the time.
2011-09-16 17:25:12 +02:00
Michel Dänzer 373234ce17 r600g: Initialize multi VGT related register on Cayman.
Prevents lockups with piglit tests draw-elements and draw-vertices using large
numbers of vertices.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alex.deucher@amd.com>
2011-09-14 18:40:16 +02:00
Marek Olšák 8dbf9d70d3 r600g: fix typo in "r600g: simplify deducing chip family" 2011-09-13 13:09:17 +02:00
Marek Olšák ac028b20e5 r600g: set the return type of radeon_destroy to void 2011-09-12 22:03:03 +02:00
Marek Olšák b87bc2eb44 r600g: remove r600_drm_public.h 2011-09-12 22:03:03 +02:00
Marek Olšák 1a532ca79a r600g: inline some of the winsys r600_get functions 2011-09-12 22:03:03 +02:00
Marek Olšák 915227b0aa r600g: simplify deducing chip family 2011-09-12 22:03:03 +02:00
Marek Olšák 3603d15788 r600g: compute tiling info in the pipe, not in the winsys
The winsys doesn't need it.
2011-09-12 22:03:02 +02:00
Marek Olšák a94e33a8ef r600g: remove unused ioctl definitions 2011-09-12 22:03:02 +02:00
Marek Olšák d26b49f87f r600g: do not loop in radeon_family_from_device
Also move that function to r600_drm.c
2011-09-12 22:03:02 +02:00
Marek Olšák 85f5d7ceee r600g: cleanup build include dirs and dependencies
The scons build still depended on libdrm_radeon.
2011-09-12 22:03:02 +02:00
Marek Olšák 4682e70601 pb_buffer: inline 'base' sub-struct 2011-09-11 18:29:27 +02:00
Maarten Lankhorst 210ddf0819 winsys/radeon: Create async thread only once
I noticed that a thread was created for every time async flush was called, so I moved it and used some semaphores to synch.

Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Signed-off-by: Christian König <deathsimple@vodafone.de>
2011-08-30 14:01:57 +02:00
Kai Wasserbäch d4e8f38477 winsys/g3dvl: Fix include style
As explained in the thread starting at [0], the internal include style
should be »#include "path/to/header.h"« for non-system includes.

[0]
<http://news.gmane.org/find-root.php?message_id=%3c4E5802BE.6020206%40vmware.com%3e>

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-08-29 08:03:06 -06:00
Chia-I Wu 534df79187 android: add support for nouveau
Compile tested only.
2011-08-27 17:29:13 +08:00
Chia-I Wu 99be968e99 android: add support for i915g
Quickly tested with 945GME.  SurfaceFlinger (the display server and
compositor) works.  2D apps with RGB or RGBA visuals work.  As for 3D
apps, some work and some do not.
2011-08-27 17:29:09 +08:00
Chia-I Wu 04dbb37eaa android: add support for vmwgfx
Quickly tested with VMWare Workstation 7.1.4 on Linux with GeForce
GT220.  SurfaceFlinger (the display server and compositor) works.  2D
apps with RGB visual works.  However, due to missing
PIPE_FORMAT_R8G8B8A8_UNORM support, those with RGBA visual do not.
2011-08-27 17:28:32 +08:00
Chia-I Wu 0cc0889007 winsys/i915: share the source list
Factor out C_SOURCES from Makefile to Makefile.sources, and let Makefile
and SConscript share it.
2011-08-27 17:28:32 +08:00
Chia-I Wu f9b55e23af winsys/svga: share the source list
Factor out C_SOURCES from Makefile to Makefile.sources, and let Makefile
and SConscript share it.
2011-08-27 17:28:32 +08:00
Chia-I Wu 7b1972d7be android: add support for r600g
Tested with a Radeon HD 6250.  SurfaceFlinger (the display server and
compositor) works.  2D apps with RGB or RGBA visuals work.  As for 3D
apps, some work but some don't (with serious rendering defects).

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2011-08-25 08:54:16 +08:00
Chia-I Wu 689b45fb27 winsys/radeon: share the source list
Factor out C_SOURCES from Makefile to Makefile.sources, and let
Makefile and SConscript share it.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2011-08-25 08:54:16 +08:00
Chia-I Wu 027a45e5cf winsys/r600: share the source list
Factor out C_SOURCES from Makefile to Makefile.sources, and let
Makefile and SConscript share it.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2011-08-25 08:54:16 +08:00
Chia-I Wu 1284d5b255 winsys/svga: use os_mmap() for memory mapping
os_mmap() guarantees large file support across OSes.
2011-08-24 10:57:12 +08:00
Chia-I Wu 70b1837dfb winsys/radeon: use os_mmap() for memory mapping
os_mmap() guarantees large file support across OSes.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2011-08-24 10:57:12 +08:00
Chia-I Wu 9650483acd winsys/sw/android: use HAL formats
Native buffers use HAL formats, not UI formats.
2011-08-21 02:01:49 +08:00
Chia-I Wu f496d8b86d winsys/sw/android: set bo usage correctly
Since this is the software path, set GRALLOC_USAGE_SW_WRITE_OFTEN when
PIPE_BIND_RENDER_TARGET, and set GRALLOC_USAGE_SW_READ_OFTEN when
PIPE_BIND_SAMPLER_VIEW.
2011-08-21 02:01:49 +08:00
Chia-I Wu 15576344f7 android: build android sw winsys
This builds the static library libmesa_winsys_sw_android from winsys/sw.
2011-08-21 02:01:49 +08:00
Chia-I Wu 8e54c47a61 winsys/android: new SW winsys for Android
On Android, color buffers are passed between server and clients as
opaque buffer_handle_t.  This winsys makes use of gralloc, which
provides a generic way to map and unmap buffer_handle_t for CPU access.
2011-08-21 02:01:48 +08:00
Marek Olšák 01680ce2f3 r600g: implement NV_primitive_restart functionality (v2)
Needed for GL3.

v2: evergreen support

I don't set PA_SU_SC_MODE_CNTL.MULTI_PRIM_IB_ENA.
piglit/primitive-restart does pass though. Tested on RV730 and EG-REDWOOD.
2011-08-18 00:25:07 +02:00
Marek Olšák a77431b3b0 r600g: consolidate two files r600d.h 2011-08-16 09:15:11 +02:00
Marek Olšák 47dcfb8dab r600g: set read/write usage flags for each relocation
This takes advantage of the new GEM_WAIT ioctl when mapping buffers.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:11 +02:00
Marek Olšák ebfcc58b93 winsys/radeon: take advantage of the new ioctl
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:11 +02:00
Marek Olšák 1e3c81a068 winsys/radeon: hook up the new DRM_RADEON_GEM_WAIT ioctl
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:11 +02:00
Marek Olšák 296b899095 winsys/radeon: remove broken bo-is-busy-for-write guessing
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:11 +02:00
Marek Olšák c79e9f0ed5 r600g: enable thread offloading
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:11 +02:00
Marek Olšák 0bbbd82488 r600g: undefine RADEON_CTX_MAX_PM4
winsys/radeon has its own definition.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:11 +02:00
Marek Olšák d6da5185f9 r600g: don't include radeon_drm.h and xf86drm.h
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:11 +02:00
Marek Olšák efbccfeca0 winsys/radeon: remove the device file descriptor from the interface
r600g doesn't need it anymore.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:11 +02:00
Marek Olšák 041ed559e1 r600g: remove an unused parameter from r600_bo_destroy
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:11 +02:00
Marek Olšák c6fec83726 r600g: merge radeon_bo with r600_bo
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:11 +02:00
Marek Olšák 5229ba494b r600g: remove radeon_bo::handle
This should be private to radeon_winsys.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:11 +02:00
Marek Olšák ab630b5768 r600g: use buffer_map/unmap from radeon_winsys
This also drops the unneeded bo_busy/wait functions.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:11 +02:00
Marek Olšák e2e1dc9e66 r600g: set the flush callback in radeon_winsys
I have also renamed the winsys function.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:11 +02:00
Marek Olšák 7ee65800c3 r600g: get tiling flags using radeon_winsys
Also remove some unused fence-related leftovers.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:11 +02:00
Marek Olšák ecfcf25387 r600g: get winsys_handle using radeon_winsys
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:11 +02:00
Marek Olšák 1b542aca6e r600g: move more DRM queries into winsys/radeon
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:11 +02:00
Marek Olšák 03b25ad8ff winsys/radeon: consolidate the add_reloc function
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:10 +02:00
Marek Olšák e6fb62594f r600g: emit CS using radeon_winsys
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:10 +02:00
Marek Olšák 685b8345a8 r600g: remove struct r600_reloc
That is really private to winsys/radeon.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:10 +02:00
Marek Olšák 1acaf09778 r600g: don't use RADEON_GEM_DOMAIN_CPU
Also staging resources shouldn't be allocated with the initial domain
being VRAM.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:10 +02:00
Marek Olšák 3e57972216 r600g: remove reloc-related variables from radeon_bo
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:10 +02:00
Marek Olšák 638d75185e r600g: let radeon_winsys maintain the list of relocations
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:10 +02:00
Marek Olšák 9865b1ec8c r600g: remove now-unused r600_context::fenced_bo
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:10 +02:00
Marek Olšák 591d8c3350 r600g: remove the fences which were used for the cache buffer manager
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:10 +02:00
Marek Olšák cdbb8a195a r600g: remove now-unused r600_bo::size
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:10 +02:00
Marek Olšák 60ff68ad00 r600g: remove the cache buffer manager from winsys/r600
As we've just started using the one from winsys/radeon.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:10 +02:00
Marek Olšák 11daa7e325 r600g: allocate/destroy buffers using radeon_winsys
We use the cache buffer manager from radeon_winsys now, but we don't use
anything else yet.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:10 +02:00
Marek Olšák edca57e533 r600g: remove unused function declarations
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:10 +02:00
Marek Olšák 39db886548 r600g: remove unused r600_bo::tiling_flags
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:10 +02:00
Marek Olšák c092e236cc r600g: remove unused r600_bo::kernel_pitch
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:10 +02:00
Marek Olšák 2ce783d8dd r600g: put radeon_winsys in screen::winsys, don't include drm_driver in the pipe
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:10 +02:00
Marek Olšák 354f76f386 r600g: cleanup includes in winsys
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:10 +02:00
Marek Olšák fb8cf51eeb r600g: move some queries into winsys/radeon
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:10 +02:00
Marek Olšák ce12f82692 r600g: first step into winsys/radeon
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:10 +02:00
Marek Olšák 1554e69e00 winsys/radeon: disable use of the buffer busy-for-write flag 2011-08-06 05:45:19 +02:00
Marek Olšák 5b005ecc2b winsys/radeon: do the CS cleanup in the CS ioctl thread 2011-08-05 07:08:18 +02:00
Marek Olšák 64ab39b035 winsys/radeon: fix space checking
We should remove the relocations which caused a validation failure
from the list, so that the kernel receives only the validated ones.

NOTE: This is a candidate for the 7.11 branch.
2011-08-05 07:08:18 +02:00
Vadim Girlin 6eb94fc344 r600g: use backend mask for occlusion queries
Use backend_map kernel query if supported, otherwise analyze ZPASS_DONE
results to get the mask.

Fixes lockups with predicated rendering due to incorrect query buffer
initialization on some cards.

Note: this is a candidate for the 7.11 branch.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-03 10:17:44 -04:00
Marek Olšák 2664980760 winsys/radeon: remove dummy function pb_buffer 2011-08-03 01:18:10 +02:00
Marek Olšák e69dde5233 r600g: remove dummy function r600_bo_offset
Always returned 0.
2011-08-02 18:52:17 +02:00
Marek Olšák f6df430a85 r600g: remove unused code 2011-08-02 18:52:17 +02:00
Marek Olšák f170555a18 winsys/radeon: fix typos in the driver interface 2011-07-25 23:10:40 +02:00
Marek Olšák 533e228923 winsys/radeon: manage constant buffers by the cache bufmgr too 2011-07-25 23:10:40 +02:00
Marek Olšák 7db148d3a5 winsys/radeon: remove usage parameter from buffer_create 2011-07-25 23:10:40 +02:00
Marek Olšák e22a1005c0 winsys/radeon: fix int->boolean conversion in radeon_bo_is_referenced_by_any_cs 2011-07-25 23:10:40 +02:00
Marek Olšák 67c995e0f1 winsys/radeon: little change in radeon_bo_is_referenced_by_cs 2011-07-25 23:10:40 +02:00
Marek Olšák ce9daf6f0b winsys/radeon: add R300 infix to winsys feature names 2011-07-25 23:10:39 +02:00
Marek Olšák 28a336dc38 winsys/radeon: simplify how value queries work
This drops the get_value query and adds a function query_info, which returns
all the values in one nice structure.
2011-07-25 23:10:39 +02:00
Vadim Girlin 9b3ec69cf4 r600g: fix corner case checks for the queries 2011-07-18 08:53:47 -04:00
Henri Verbeet 3093cbaad9 r600g: Get rid of leftover PB_USAGE_* flags.
These happen to work because their values are the same as the equivalent
PIPE_TRANSFER_* flags, but it's still misleading.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-07-18 01:36:07 +02:00
Marek Olšák 036fb07908 r600g: print to stderr that a CS has been rejected by the kernel
Just fixing the warning that r is unused.
2011-07-15 21:48:29 +02:00
Vadim Girlin ef29bfee03 r600g: fix queries and predication
Use all zpass data for predication instead of the last block only.
Use query buffer as a ring instead of reusing the same area
for each new BeginQuery. All query buffer offsets are in bytes
to simplify offsets math.
2011-07-15 15:42:46 -04:00
Christian König ed24e19070 Merge branch 'pipe-video' 2011-07-13 22:56:06 +02:00
Stéphane Marchesin 85e1fa5506 i915g: don't try to check if a NULL buffer is busy. 2011-07-13 11:59:10 -07:00
Christian König a2a6799fbe [g3dvl] remove some unneeded Makefiles 2011-07-13 19:37:28 +02:00
Christian König c8dd301b6f r600g: revert "set BLEND_CLAMP depending on clamp_fragment_color"
BLEND_CLAMP doesn't seems to be the right way to implement "ARB_color_buffer_float".
2011-07-13 15:54:28 +02:00
Alex Deucher 5d0d8366f9 r600g: emit SQ_LDS_RESOURCE_MGMT
Need to be initialized to a reasonable value as
compute code may change it.

Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=39119

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-07-12 12:01:25 -04:00
Christian König f919547f37 Merge remote-tracking branch 'origin/master' into pipe-video
Conflicts:
	src/gallium/drivers/r600/r600_pipe.c
	src/gallium/drivers/r600/r600_state_inlines.h
2011-07-11 10:48:59 +02:00
Marek Olšák dc9d789d1b r600g: more valgrind fixes 2011-07-11 04:13:35 +02:00
Marek Olšák daf6604435 r600g: zero memory of ioctl parameters
Fixes valgrind warning.
2011-07-11 04:01:06 +02:00
Henri Verbeet 2e53725bbc r600g: Check for Evergreen chip class instead of Cedar family in r600_context_flush().
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-07-09 18:12:50 +02:00
Christian König 3ed8182c76 [g3dvl] stop calling dri2DestroyDrawable
When switching channels with xine it sometimes happens that xine
destroys the drawable before we get a chance to call
DRI2DestroyDrawable, resulting in an x error.
2011-07-09 00:00:10 +02:00
Christian König ea78480029 [g3dvl] and finally remove pipe_video_context 2011-07-08 19:22:43 +02:00
Christian König 3bb33c911b [g3dvl] remove the unused priv member from pipe_video_context 2011-07-08 15:07:39 +02:00
Christian König 06ddbc3b8e [g3dvl] remove create_surface from video context 2011-07-08 12:15:48 +02:00
Christian König 2ec350ff1d [g3dvl] make pipe_context mandatory for creation pipe_video_context 2011-07-08 12:03:13 +02:00
Stéphane Marchesin e53b41f263 i915g: Improve flushing using heuristics. 2011-07-06 02:49:58 -07:00
Vadim Girlin 6bde225b8b r600g: fix buffer overflow check in r600_query_begin 2011-07-05 15:57:11 -04:00
Vadim Girlin 971e1b743e r600g: fix bo map usage flags in r600_query_begin 2011-07-05 15:57:08 -04:00
Vadim Girlin fbe9d4261f r600g: reduce flushes for queries 2011-07-05 15:57:06 -04:00
Vadim Girlin 9bf4c30d73 r600g: fix buffer offset in r600_query_begin 2011-07-05 15:57:01 -04:00
Christian König c3b2230b71 Merge remote-tracking branch 'origin/master' into pipe-video
Conflicts:
	configure.ac
	src/gallium/drivers/r600/r600_state_inlines.h
	src/gallium/tests/trivial/Makefile
	src/gallium/winsys/g3dvl/dri/XF86dri.c
	src/gallium/winsys/g3dvl/dri/driclient.c
	src/gallium/winsys/g3dvl/dri/driclient.h
	src/gallium/winsys/g3dvl/dri/xf86dri.h
	src/gallium/winsys/g3dvl/dri/xf86dristr.h
	src/gallium/winsys/r600/drm/r600_bo.c
2011-07-04 15:04:41 +02:00
Vadim Girlin 61c976c3cc r600g: fix check for empty cs 2011-06-30 16:39:08 -04:00
José Fonseca 235225ec93 scons: Expose pkg-config in a simpler manner. 2011-06-30 17:36:37 +01:00
Chia-I Wu aa281dd392 st/egl: update fbdev backend
Considering fbdev as an in-kernel window system,

 - opening a device opens a connection
 - there is only one window: the framebuffer
 - fb_var_screeninfo decides window position, size, and even color format
 - there is no pixmap

Now EGL is built on top of this window system.  So we should have

 - the fd as the handle of the native display
 - reject all but one native window: NULL
 - no pixmap support

modeset support is still around, but it should be removed soon.
2011-06-28 15:07:30 +09:00
Alex Deucher c4930cb417 r600g: fix num_banks interpretation on eg+
Field is encoded:
0 = 4 banks
1 = 8 banks
2 = 16 banks

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-22 12:34:37 -04:00
Benjamin Franzke 8c91d751c8 winsys/wayland: Fix warning 2011-06-21 13:11:43 -04:00
Mathias Fröhlich b0f1767d77 r600g: Allow VRAM for the initial domain for every buffer binding. 2011-06-13 11:33:14 -04:00
Mathias Fröhlich e1f88016ec r600g: Set the domains value also for recycled buffer objects. 2011-06-13 11:31:55 -04:00
Daniel Vetter 219150433a i915g: implement fence signalling
v2: Incorporated feedback from Jakob Bornecrantz.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-06-11 17:11:26 +02:00
Alex Deucher eca3e910ed r600g: VGT_PRIMITIVE_TYPE is special
It's a special reg and does not require a flush like
the other CONFIG regs.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-09 16:54:23 -04:00
Alex Deucher 8681ebcf7f r600g: Handle CONFIG regs properly
CONFIG regs (byte offsets 0x8000-0xac00) are single state and the pipeline
must be flushed and hw idle when they are changed.  Border color regs
are in the CONFIG range and this is why a flush is required when changing
them.  CONTEXT regs (byte offset 0x28000+) are multi-state and those do
not require flushes when changing them.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-09 16:26:50 -04:00
Christian König 003401f95c Merge remote-tracking branch 'origin/master' into pipe-video
Conflicts:
	src/gallium/tests/unit/u_format_test.c
	src/gallium/winsys/r600/drm/r600_hw_context.c
2011-06-09 09:35:09 +02:00
Dave Airlie 04554c7d3a r600g: adjust vs/ps gprs on r600/r700 cards when needed.
Ideally we'd have a compiler and register spilling and all that
but this is good enough for now to avoid the gpu hang in piglit,

glsl-vs-vec4-indexing-temp-dst-in-nested-loop-combined

on r600/r700 cards.

based on r600c patch
Andre Maasikas <amaasikas@gmail.com>
r600c: bump sq gpr resources if a shader needs more than default

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-09 11:25:02 +10:00
Brian Paul 5f2deba9f3 gallium: s/bool/boolean/ 2011-06-08 08:05:40 -06:00
Dave Airlie 9fb404b47e r600g: set enable always bits for r600/r700 sq registers.
This makes sure these are enabled even if set to 0 at startup.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 14:50:58 +10:00
Dave Airlie e84981dede r600g: fix warnings in winsys.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 14:11:49 +10:00
Dave Airlie c1f9884bbf r600g: enable dynamic GPR resource management on evergreen
Evergreen can do this as well as cayman, so we should enable it.

This fixes a gpu lockup with
glsl-vs-vec4-indexing-temp-dst-in-nested-loop-combined.shader_test

I need to add a better workaround for r600/r700.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 14:11:48 +10:00
Dave Airlie f659cc46bc r600g: only add blocks once to the dirty/enabled lists.
This caused a loop in some tests.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 14:04:26 +10:00
Dave Airlie a5329d4f78 r600g: fix regression in recent state changes.
We weren't emitting the SQ setup regs at all which really is
fail.

When a state is always enabled we need to add it to the dirty list
as well.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 13:22:02 +10:00
Dave Airlie 745abb53cf r600g: move simple part of bo reloc processing inline.
This just moves the messy stuff out of the fast path,
and leaves the fast-case in the fast path.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 11:47:01 +10:00
Dave Airlie ba78a5a679 r600g: split resource emit path from main register emit path
Since resources don't generally vary in size, this splits
the emit path, it also takes into a/c that texture and vertex resources
have different number of relocs, and avoids emitting the extra
reloc for vertex resources.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 11:47:00 +10:00
Dave Airlie ff8717527d r600g: exit bo per reg scanning loop early.
Exit this loop early to avoid pointless iterations later.

Move the resource bos to the first two regs, it actually
doesn't matter which regs we use for this in resource land.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 11:47:00 +10:00
Dave Airlie 138f660b58 r600g: reorder evergreen draw packets to be smaller.
We were always re-emitting lots of unnecessary changes here,
avoid doing that.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 11:47:00 +10:00
Dave Airlie 4707ae20ad r600g: inline r600_bo_reference.
This relies on the reference member being first, so document it.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 11:46:59 +10:00
Dave Airlie ff298a66d7 r600g: no need to drop the references here.
We drop them when we reference the new objects in the next line.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 11:46:59 +10:00
Dave Airlie e21601e46e r600g: use memcmp instead of a loop in state_set_resource
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 11:46:50 +10:00
Pierre-Eric Pelloux-Prayer bdf2e11285 r600g : fix incorrect size computation in r600_query_result
query->num_results already has the size in dwords of the query
buffer.  There no need to multiply again.  We were reading past
the end of the buffer, resulting in reading garbage.

Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=37028

agd5f: clarify the comment.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-07 17:40:37 -04:00
Alex Deucher 5d4c479822 r600g: remove pre-r6xx asic families and pci ids
Not sure why these were included originally.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-07 17:04:52 -04:00
Alex Deucher 7c1d478192 r600g: always clear query memory
According to the hw documentation, the driver needs to:
- allocate 128 bits for each possible DB
- clear the 128 bits for each possible DB
- write 1 to bits 127 and 63 for upper DBs that don't
exist on a particular asic

Previously we were only doing these steps if the
asic had less than the max possible DBs.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-07 16:44:40 -04:00
Benjamin Franzke 42ba8d141f r300g: Remove is_r3xx
Use r300_pci_ids.h instead.

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-07 10:28:20 -04:00
Benjamin Franzke 2bb253120e r600g: Use radeon pciid list for the family lookup table
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-07 10:28:20 -04:00
Dave Airlie ca01fe007d r600g: optimise the draw emission packets for r600/eg
This just reduces code size a bit for this chunk.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-07 09:43:09 +10:00
Dave Airlie 63184bc8b2 r600g: use an enabled list to track enabled blocks.
At the end of flushing we were scanning over 450 blocks
with generally about 50 enabled. This reduces the scanning
to just the list of enabled blocks.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-07 09:33:53 +10:00
Dave Airlie f356bb74de r600g/winsys: overhaul resource range/blocks.
There isn't much point taking the overhead of range/block lookups on resources
we aren't going to be getting resource registers at wierd offsets.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-07 09:32:29 +10:00
Dave Airlie be7af43f5a r600g: split out block init
This just splits this function up as pre-cursor to reusing
the internals of it.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-07 09:32:00 +10:00
Dave Airlie cf0f02e501 r600g: move resource setting to its own structures.
resource setting could be a fair bit more lightweight,
this patch just separates the resource structs from the standard
reg tracking structs in the driver, later patches will improve
the winsys.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-07 09:30:55 +10:00
Dave Airlie eb4bb48ef4 r600g: only call bo loop if nbos is positive.
we don't need to loop over all the registers unless we have
some bos in the block, also avoid setting the ctx flags,
and move the optional stuff down below this chunk.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-07 09:28:59 +10:00
Dave Airlie 6cd3534676 r600g: don't need to call the packet dirty function if not dirty.
also fix a unneeded dirty check and add a dirty check speedup.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-07 09:25:50 +10:00
Christian König 1eb957bb41 Merge remote-tracking branch 'origin/master' into pipe-video 2011-06-05 00:11:41 +02:00
Dave Airlie 4423c79ddf r600g: work out range/block etc at state build time.
This moves the overhead of working out the range/block to state build time,
it also allows the compiler to use constants for a lot of things instead
of working them out each time.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-02 14:59:29 +10:00
Dave Airlie 991dbd71fd r600g: migrate macros from r600_priv.h to r600.h
this is just an precursor change for some later patches.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-02 14:42:11 +10:00
Dave Airlie c1159eea54 r600g: remote ctx arg to block/range macros.
These aren't used anymore.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-02 14:40:40 +10:00
Dave Airlie 8782fdc1db r600g: avoid copying unnecessary pieces of a block.
This just avoids copying stuff if its going to modify the number of dwords
later anyways.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-02 14:29:37 +10:00
Dave Airlie 8fcafeb475 r600g: force new evergreen blocks for large range.
This range was 76 dwords long, the 75th dword changes, the first 60 or so
don't. split the block so it emits less often.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-02 14:22:42 +10:00
Alex Deucher 414cd5df50 r600g: add llano support
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-31 18:10:01 -04:00
Alex Deucher b5518834e3 r600g: cs init fixes
- all asics need to emit CONTEXT_CONTROL
- all r6xx asics need to emit 3D_START_CMDBUF

The ddx and r600c already do this. r600g should as well.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-31 10:43:31 -04:00
Dave Airlie 0cdd82df53 r600g: add context control to start of CS
On my original R600 card this at least lets gnome shell run for a while longer
and the piglit r300-readcache test case works a lot more reliably.

Still a few more stability issues running a piglit test run though.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-31 15:42:45 +10:00
Dave Airlie 65ee7cd1df r600g: don't emit color blend register on original R600.
The original R600 doesn't have these so don't emit them.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-31 10:52:07 +10:00
Dave Airlie 7779f6d1df r600g: add initial cayman acceleration support.
Cayman is the RadeonHD 69xx series of GPUs. This adds support for
3D acceleration to the r600g driver.

Major changes:
Some context registers moved around - mainly MSAA and clipping/guardband related.
GPR allocation is all dynamic
no vertex cache - all unified in texture cache.
5-wide to 4-wide shader engines (no scalar or trans slot)
	- some changes to how instructions are placed into slots
	- removal of END_OF_PROGRAM bit in favour of END flow control clause
	- no vertex fetch clause - TC accepts vertex or texture

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-25 11:42:45 +10:00
Dave Airlie ece871c038 r600g: flush the DB dest base as well.
If we do this for CB bases then we should do it for DB bases.

noticed while adding cayman support.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-25 09:37:33 +10:00
Christian König aa63ebc48a Merge remote-tracking branch 'origin/master' into pipe-video 2011-05-21 16:43:12 +02:00
Dave Airlie ecc051d65b r600g: bump domain selection up one layer.
this is taken from a patch from Mathias Froehlich, just going to
stage it in a few pieces.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-18 17:31:51 +10:00
Christian König 828540e491 Merge remote-tracking branch 'origin/master' into pipe-video 2011-05-15 19:26:53 +02:00
Dave Airlie bd5b7a6f71 r600g: reduce flushes so only when texture and CB overlap.
We only need to do this when the texture and CB are using the
same memory area.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-15 18:09:15 +10:00
Marek Olšák fdd37af3f7 r300g: dynamically ask for and release Hyper-Z access
We ask for Hyper-Z access when clearing a zbuffer.
We release it if no zbuffer clear has been done for 2 seconds.
2011-05-15 03:28:32 +02:00
Dave Airlie c7b1497f4e r600g: don't unmap if we haven't mapped
should fix https://bugs.freedesktop.org/show_bug.cgi?id=37157

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-13 14:03:47 +10:00
Dave Airlie 1ca3efe548 r600g: use a local var to store pointer to which register we are working on
this just makes the code a little bit cleaner.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-13 09:26:17 +10:00
Dave Airlie 240049adfa r600g: make range/block act more like a page table
only allocate the blocks ptr in the range if we ever have one,
otherwise don't bother wasting the memory.

valgrind glxinfo
before:
==967==     in use at exit: 419,754 bytes in 706 blocks
==967==   total heap usage: 3,552 allocs, 2,846 frees, 3,550,131 bytes allocated

after:
==5227==     in use at exit: 419,754 bytes in 706 blocks
==5227==   total heap usage: 3,452 allocs, 2,746 frees, 3,140,531 bytes allocate

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-13 09:26:16 +10:00
Dave Airlie d79a4a612b r600g: reduce r600_reg footprint
This drops 6k of the text segment, a minor drop in the ocean, however
it also makes the code a lot cleaner and removes a lot of duplicated
information, hopefully making it more maintainable.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-13 09:22:41 +10:00
Dave Airlie d015d2f391 r600g: reduce memory usage from range/block hash table.
This table covered a large range unnecessarily, reduce the address
range covered, use the fact that the bottom two bits aren't significant,
and remove unused fields from the range struct. It also drops the hash_size/shift in context in favour of a define, which should make doing the math
a bit less CPU intensive.

valgrind glxinfo
Before:
==320==     in use at exit: 419,754 bytes in 706 blocks
==320==   total heap usage: 3,691 allocs, 2,985 frees, 7,272,467 bytes allocated

After:
==967==     in use at exit: 419,754 bytes in 706 blocks
==967==   total heap usage: 3,552 allocs, 2,846 frees, 3,550,131 bytes allocated

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-13 09:22:40 +10:00
Dave Airlie 5e15497452 r600g: delay mapping until first map request. (v2)
Currently r600g always maps every bo, this is quite pointless as it wastes
VM and on 32-bit with wine running VM space is quite useful.

So with this patch we don't create the mappings until first use, without
tiling enabled this probably won't make a major difference on its own,
but with tiled staged uploads it should avoid keeping maps for most of the
textures unnecessarily.

v2: add bo data ptr check

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-13 09:22:39 +10:00
Alex Deucher b9f2750900 r600g: fix flushes on rs780/rs880
They need the same hack as rv670.

Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=35312

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-11 12:10:01 -04:00
José Fonseca 2812b60a84 svga/drm: Implement svga_winsys_screen::get_hw_version. 2011-05-10 16:36:35 +01:00
Christian König 213b9004a6 Merge remote-tracking branch 'origin/master' into pipe-video
Conflicts:
	src/gallium/drivers/r600/r600_state.c
2011-05-07 14:11:40 +02:00
Alex Deucher 3b20a89941 r600g: avoid recursion in rv670 flush workaround
Should fix:
https://bugs.freedesktop.org/show_bug.cgi?id=36914

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-06 13:19:21 -04:00
Kostas Georgiou 8c3226be90 Add pci id for FirePro 2270
Signed-off-by: Kostas Georgiou <georgiou@opengamma.com>
2011-05-06 13:03:40 -04:00
Alex Deucher bf7a3ddca6 r600g: further r6xx cache flush fixes
Don't emit sync packets for additional CBs or DB.
Spotted by Fredrik Höglund.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-05 18:45:55 -04:00
Dave Airlie 5066f7cd0e r600g: add rv670 flushing workaround.
Hopefully we can find out the proper fix for this, but for now
this makes the fbo mipmap tests pass on my rv670 (x2 card).

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-06 08:41:13 +10:00
Alex Deucher d116fe51c1 r600g: fix cache flushes on r6xx
r6xx asics have some problems with the surface
sync logic for the CB and DB.  It's recommended
to use the event write interface for flushing
the DB/CB caches rather than the sync packets.
A single event write flush flushes all dst
caches, so we only need one for all CBs and DB.

Should fix:
https://bugs.freedesktop.org/show_bug.cgi?id=35312

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-06 08:07:12 +10:00
Dave Airlie ae7abf080b r600g: do RV6xx base updates inline with state updates.
This seems more in line with what the documentation suggests we should be
doing. It doesn't fix the rv635 regression, though I thought it might,
so it means I've no idea whats actually going wrong there.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-05 09:07:49 +10:00
Brian Paul fc30910c65 i915g: add const qualifier to silence warning 2011-05-03 18:56:20 -06:00
Alex Deucher c120d9d1cc r600g: add some new pci ids
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-03 15:26:07 -04:00
Christian König e602ecf9ef r600g: revert commit 68cc6bc5d8
Revert commit "remove the unneeded bo from COLOR[0-9]_INFO
Also implement a working alternative.
2011-04-26 19:09:45 +02:00
Benjamin Franzke 6a35ed1f66 winsys/wayland: Fix typo in Makefile
Reported by dir1212 on irc.
2011-04-25 18:17:07 +02:00
Benjamin Franzke aaa3c0d6de winsys: Add wayland shm sw winsys 2011-04-25 10:45:56 -04:00
Marek Olšák 71667533d1 r600g: remove some pointless and unused functions 2011-04-25 01:20:40 +02:00
Marek Olšák 512c814849 r600g: do not reset device to 0 when doing unrelated operations
Seems to be a copy-paste bug.
2011-04-25 01:20:40 +02:00
Christian König 68cc6bc5d8 r600g: remove the unneeded bo from COLOR[0-9]_INFO
The COLOR[0-7]_INFO registers doesn't neeed a bo.
2011-04-24 12:47:42 +02:00
Christian König fa31b1095e Merge remote branch 'origin/master' into pipe-video
Conflicts:
	configs/linux-dri
	src/gallium/drivers/r600/r600_pipe.c
	src/gallium/drivers/r600/r600_state.c
	src/gallium/include/pipe/p_format.h
	src/gallium/tests/graw/fragment-shader/frag-abs.sh
	src/gallium/tests/graw/fragment-shader/frag-add.sh
	src/gallium/tests/graw/fragment-shader/frag-cb-1d.sh
	src/gallium/tests/graw/fragment-shader/frag-cb-2d.sh
	src/gallium/tests/graw/fragment-shader/frag-dp3.sh
	src/gallium/tests/graw/fragment-shader/frag-dp4.sh
	src/gallium/tests/graw/fragment-shader/frag-dst.sh
	src/gallium/tests/graw/fragment-shader/frag-ex2.sh
	src/gallium/tests/graw/fragment-shader/frag-face.sh
	src/gallium/tests/graw/fragment-shader/frag-flr.sh
	src/gallium/tests/graw/fragment-shader/frag-frc.sh
	src/gallium/tests/graw/fragment-shader/frag-kil.sh
	src/gallium/tests/graw/fragment-shader/frag-lg2.sh
	src/gallium/tests/graw/fragment-shader/frag-lit.sh
	src/gallium/tests/graw/fragment-shader/frag-lrp.sh
	src/gallium/tests/graw/fragment-shader/frag-mad-immx.sh
	src/gallium/tests/graw/fragment-shader/frag-mad.sh
	src/gallium/tests/graw/fragment-shader/frag-max.sh
	src/gallium/tests/graw/fragment-shader/frag-min.sh
	src/gallium/tests/graw/fragment-shader/frag-mov.sh
	src/gallium/tests/graw/fragment-shader/frag-mul.sh
	src/gallium/tests/graw/fragment-shader/frag-rcp.sh
	src/gallium/tests/graw/fragment-shader/frag-rsq.sh
	src/gallium/tests/graw/fragment-shader/frag-sge.sh
	src/gallium/tests/graw/fragment-shader/frag-slt.sh
	src/gallium/tests/graw/fragment-shader/frag-srcmod-abs.sh
	src/gallium/tests/graw/fragment-shader/frag-srcmod-absneg.sh
	src/gallium/tests/graw/fragment-shader/frag-srcmod-neg.sh
	src/gallium/tests/graw/fragment-shader/frag-srcmod-swz.sh
	src/gallium/tests/graw/fragment-shader/frag-sub.sh
	src/gallium/tests/graw/fragment-shader/frag-tempx.sh
	src/gallium/tests/graw/fragment-shader/frag-xpd.sh
	src/gallium/tests/graw/vertex-shader/vert-abs.sh
	src/gallium/tests/graw/vertex-shader/vert-add.sh
	src/gallium/tests/graw/vertex-shader/vert-arl.sh
	src/gallium/tests/graw/vertex-shader/vert-arr.sh
	src/gallium/tests/graw/vertex-shader/vert-cb-1d.sh
	src/gallium/tests/graw/vertex-shader/vert-cb-2d.sh
	src/gallium/tests/graw/vertex-shader/vert-dp3.sh
	src/gallium/tests/graw/vertex-shader/vert-dp4.sh
	src/gallium/tests/graw/vertex-shader/vert-dst.sh
	src/gallium/tests/graw/vertex-shader/vert-ex2.sh
	src/gallium/tests/graw/vertex-shader/vert-flr.sh
	src/gallium/tests/graw/vertex-shader/vert-frc.sh
	src/gallium/tests/graw/vertex-shader/vert-lg2.sh
	src/gallium/tests/graw/vertex-shader/vert-lit.sh
	src/gallium/tests/graw/vertex-shader/vert-lrp.sh
	src/gallium/tests/graw/vertex-shader/vert-mad.sh
	src/gallium/tests/graw/vertex-shader/vert-max.sh
	src/gallium/tests/graw/vertex-shader/vert-min.sh
	src/gallium/tests/graw/vertex-shader/vert-mov.sh
	src/gallium/tests/graw/vertex-shader/vert-mul.sh
	src/gallium/tests/graw/vertex-shader/vert-rcp.sh
	src/gallium/tests/graw/vertex-shader/vert-rsq.sh
	src/gallium/tests/graw/vertex-shader/vert-sge.sh
	src/gallium/tests/graw/vertex-shader/vert-slt.sh
	src/gallium/tests/graw/vertex-shader/vert-srcmod-abs.sh
	src/gallium/tests/graw/vertex-shader/vert-srcmod-absneg.sh
	src/gallium/tests/graw/vertex-shader/vert-srcmod-neg.sh
	src/gallium/tests/graw/vertex-shader/vert-srcmod-swz.sh
	src/gallium/tests/graw/vertex-shader/vert-sub.sh
	src/gallium/tests/graw/vertex-shader/vert-xpd.sh
	src/gallium/tools/trace/dump.py
	src/gallium/tools/trace/format.py
	src/gallium/tools/trace/model.py
	src/gallium/tools/trace/parse.py
2011-04-23 14:27:40 +02:00
Alex Deucher abee17057f r600g: fix userspace fences again
reinstate b7617346dc after the
rework in 6067a2a67f.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-20 13:09:09 -04:00
Fredrik Höglund 6067a2a67f r600g: don't flush the dest caches on every draw
Keep track of when the caches are dirty, and only flush them when
the framebuffer state is set and when the context is flushed.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-20 09:08:15 +10:00
Dave Airlie 723e35d4a6 r600g: make loop const always flush
this needs revisiting, we really don't want to be flushing all 32 of these,
but currently we don't flush any of them, and it seems to have caused a regression
as reported on irc with doom3 on evergreen.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-19 16:39:50 +10:00
Dave Airlie f05adb83f5 r600g: add dirty tracking to context reg.
just makes the code more consistent.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-19 10:12:20 +10:00
Dave Airlie 5b5a16e320 r600g: deinline some large functions.
really at these sort of sizes these are pointless inlines.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-19 10:12:20 +10:00
Dave Airlie a6e32da8bd r600g: consolidate r600/evergreen code for resource emission.
These really didn't have much difference, and totally not inline material.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-19 10:12:20 +10:00
Bas Nieuwenhuizen 02522b76a1 r600g: don't flush caches if we already did so, even for a subset of the flags
Merging the flushes that are left doesn't seem to give a significant
performance improvement

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-19 10:12:20 +10:00
Dave Airlie e3b9cf15bb r600g: attempt to avoid emitting resources that are the same
This just avoids reemitting resources that haven't changed.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-19 10:12:20 +10:00
Dave Airlie 162bc40eed r600g: modify block to only emit the first few dirty registers. (v2)
This gets me from 2200 to 1978 dwords for a gears frame.

This is due to us having some 32-dwords blocks in the SPI, that we only
modify the first dwords off.

v2: fix dirty reg count from Bas Nieuwenhuizen

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-19 10:12:19 +10:00
Dave Airlie c058067e57 r600g: track dirty registers better. (v2)
This is a first step to decreasing the CPU usage, by decreasing how much
stuff we pass to the GPU and hence to the kernel CS checker.

This adds a check to see if the values we need to write are actually dirty,
and avoids writing if they are. However certain register need to always
be written so we add a new flag to say which ones should be always written
if used. (Note this could probably be done cleaner with a larger refactoring,
 since I think the CONST_BUFFER_SIZE_PS/VS and CONST_CACHE_PS/VS might
be better off as a special state).

It also moves the need_bo to be a flags on the register now.

With this, a frame of gears goes from emitting 3k dwords to emitting 2k dwords,
and I'm sure it could get a lot smaller.

v2: fix some evergreen dirty bits.

Original patch from: Bas Nieuwenhuizen, I NIHed nearly the same thing
before seeing his patch on the list, oops.

Reviewed-by: Bas Nieuwenhuizen
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-19 10:12:19 +10:00
Marek Olšák d35aeff4bb r300g/winsys: rename r300->radeon and do a little cleanup
Renaming a few files, types, and functions.
Also make the winsys independent of r300g.
2011-04-18 02:52:32 +02:00
Dave Airlie 93d42571a6 r600g: use some loops.
unrolling loops is for Gentoo users, and I really want to put something
else inside these loops later.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-17 17:19:28 +10:00
Dave Airlie 70de2705b4 r600g: consolidate the same piece of cut-n-paste code into a function.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-17 17:11:36 +10:00
Christian König 8b0a9cc62c [g3dvl] get softpipe to work again 2011-04-10 00:33:36 +02:00
Marek Olšák aac4bae986 r300g: fix crash when adding a new relocation
No idea why it's so hard to reproduce.
Broken with: c35572352e

Thanks to Toni Spets for assistance.
2011-04-08 21:34:16 +02:00
Marek Olšák 9d5de0fcb6 r300g: add 'radeon: ' prefix to error messages in winsys 2011-04-08 04:38:36 +02:00
Christian König 19402275fb [g3dvl] stop waiting for replay of DRI2CopyRegion 2011-04-07 23:04:10 +02:00
Christian König d9ad3aa3b9 [g3dvl] and finally split the decoder part out of the context
This should give a good basis to implement vdpau ontop of it.
2011-04-06 00:06:20 +02:00
Alex Deucher a0fc40f0d5 r600g: add some additional ontario pci ids
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-04 11:15:18 -04:00
Marek Olšák 6caac3ecb8 r300g: do not wait for a busy BO if neither GPU nor CPU is changing it
Improves frame rate in apps with at least one user vertex buffer and
a hw index buffer.
2011-04-03 22:49:22 +02:00
Marek Olšák 9d881cbd5a r300g: remove unused RADEON_PB_USAGE_CACHE 2011-04-03 21:18:03 +02:00
Marek Olšák 652bf121f2 r300g: avoid mapping the same buffer twice
Shouldn't happen, but you never know.
2011-04-03 19:32:27 +02:00
Marek Olšák c35572352e r300g: remove the redundant reference counter in radeon_bo
We already have pb_buffer::reference::count.
2011-04-03 19:32:27 +02:00
Fredrik Höglund d04ab396a5 r600g: implement texture barrier 2011-03-29 16:54:19 -04:00
Fredrik Höglund 948e1eb8e9 r600g: implement the pipe_screen fence functions
v2: Allocate the fences from a single shared buffer object.
v3: Allocate the r600_fence structs in blocks of 16.
    Spin a few times before calling sched_yield in r600_fence_finish().
2011-03-29 16:37:04 -04:00
Vinson Lee 2737350157 i915g: Fix build.
Fix build failures introduced with commit 0fbb64a529.

Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
2011-03-28 17:37:33 -07:00
Daniel Vetter 0fbb64a529 i915g: use drm ioctl to get pci devid
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-28 21:23:31 +02:00
Dave Airlie e4b040c2b9 r600g: fix bo names causing -35 EDEADLCK
this is a port of the r300 winsys code to do the same thing.
2011-03-22 11:48:36 +10:00
Christian König 2bf95c519e Merge remote branch 'origin/master' into pipe-video
Conflicts:
	src/gallium/drivers/r600/r600_asm.c
	src/gallium/tests/unit/SConscript
2011-03-19 01:02:40 +01:00
Christian König d1655b60b0 get softpipe winsys to compile again 2011-03-19 00:06:46 +01:00
Alex Deucher 39d60610e8 r600g: fix logic error in 028987c803
Spotted by Henri on IRC.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-03-14 18:07:15 -04:00
Alex Deucher 028987c803 r600g: emit SURFACE_BASE_UPDATE packet on rv6xx
This packet is required when updating the DB, CB,
or STRMOUT base addresses on rv6xx for the surface
sync logic to work correctly.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-03-14 17:42:19 -04:00
Marek Olšák 7e02303497 gallium: remove flags from the flush function
The drivers have been changed so that they behave as if all of the flags
were set. This is already implicit in most hardware drivers and required
for multiple contexts.

Some state trackers were also abusing the PIPE_FLUSH_RENDER_CACHE flag
to decide whether flush_frontbuffer should be called.
New flag ST_FLUSH_FRONT has been added to st_api.h as a replacement.
2011-03-11 21:39:31 +01:00
Dave Airlie 9b7f377635 r600: don't close fd on failed load
This fd gets passed in from outside, closing it causes the X.org server
to crap out when the driver doesn't identify the chipset.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-03-10 12:01:43 +10:00
Vinson Lee c0d3fb4b6c scons: Fix immediate Python exceptions with SCons on SunOS.
The build still fails.
2011-03-08 17:59:57 -08:00
Marek Olšák 5650a719f0 r300g: decide whether a flush should be asynchronous when calling it
Thread offloading is not sometimes desirable, e.g. when mapping a buffer.
2011-03-08 08:23:29 +01:00
Christian König 0eccb1038a Merge remote branch 'origin/master' into pipe-video 2011-03-03 00:59:12 +01:00
Marek Olšák a6314eb47f r300g: require DRM 2.3.0 (kernel 2.6.34)
Running any older kernel is not recommended anyway.
2011-03-02 17:54:36 +01:00
Marek Olšák f6dbcb92bf r300g: do not use ioctl thread offloading on single-core machines 2011-03-02 17:54:36 +01:00
Daniel Vetter 8f9e546fde i915g: kill relocs accouting
No one ever cared. libdrm does dynamic resizing of its reloc-table,
anyway.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-01 22:18:11 +01:00
Dave Airlie a44b65312e r600g: add NV_conditional_render support.
This is reliant on a drm patch that I posted on the list + a version bump.

These will appear in drm-next today.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-03-01 15:09:00 +10:00
Dave Airlie 929be6eb95 r600g: start using drm minor version to enable things.
If the drm minor version is > 9 (i.e. whats in drm-next),
we enable s3tc + texture tiling by default now.

this changes R600_FORCE_TILING to R600_TILING which can
be set to false to disable tiling on working drm.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-03-01 15:08:50 +10:00
Christian König b97e41c7b1 Merge remote branch 'origin/master' into pipe-video 2011-02-28 23:59:53 +01:00
Daniel Vetter 3c59b3eb4b i915g/winsys: buffer validation support
v2: Add the batch bo to the libdrm validation lost, for otherwise
libdrm won't take previously used buffers into account.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-02-27 18:49:56 +01:00
Daniel Vetter e20c3255e2 i915g: add raw batchbuffer dumping in drm winsys
These files can be decoded with intel_dump_decode from the intel-gpu-tools
available at:

http://cgit.freedesktop.org/xorg/app/intel-gpu-tools/

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-02-27 16:32:38 +01:00
Jakob Bornecrantz acc290aff0 i915g: Use the same debug env vars in drm and sw winsys 2011-02-26 15:35:13 +01:00
Jakob Bornecrantz 9a371b938c i915g: Use unchecked writes in sw winsys batchbuffer 2011-02-26 15:29:21 +01:00
Vinson Lee eb17802386 scons: Reduce all Cygwin platform names to 'cygwin'.
platform.system in SCons on Cygwin includes the OS version number.
Windows XP - CYGWIN_NT-5.1
Windows Vista - CYGWIN_NT-6.0
Windows 7 - CYGWIN_NT-6.1

Reduce all Cygwin platform variants to just 'cygwin' so anything
downstream can simply use 'cygwin' instead of the different full
platform names.
2011-02-24 19:49:37 -08:00
Christian König b922a0ce12 Merge remote branch 'origin/master' into pipe-video
Conflicts:
	configure.ac
	src/gallium/auxiliary/Makefile
	src/gallium/auxiliary/SConscript
	src/gallium/drivers/r600/r600_asm.c
	src/gallium/drivers/r600/r600_asm.h
	src/gallium/drivers/r600/r600_shader.c
	src/gallium/drivers/r600/r600_state_inlines.h
	src/gallium/drivers/r600/r600_texture.c
2011-02-24 22:02:42 +01:00
Vinson Lee 100cd214e3 scons: Fix Cygwin platform names.
Fixes immediate Python exceptions with SCons on Cygwin.
2011-02-23 18:21:14 -08:00
Jakob Bornecrantz fbd681f1a0 i915g: Use dump function in sw winsys 2011-02-24 00:26:02 +00:00
Daniel Vetter 55a3c35243 i915g: add some throttling
Intel classic drivers switched to this, too, so it must be good.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-02-21 23:42:54 +00:00
Daniel Vetter 1e966636d0 i915g: s/bool/boolean/ style-fixup in winsys
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-02-21 23:42:53 +00:00
Jakob Bornecrantz 593ba7b05b i915g: Fix warning 2011-02-21 23:42:53 +00:00
Vinson Lee 8033700814 i915g: s/__func__/__FUNCTION__/ 2011-02-20 21:23:45 -08:00
Daniel Vetter c0122daf10 i915g: kill remnants of mmapped batchbuffer support
We're using bo_subdata.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-02-21 00:50:16 +01:00
Jakob Bornecrantz fa186804a6 i915g: Add winsys/i915/sw to scons build 2011-02-21 00:50:16 +01:00
Jakob Bornecrantz 20ff6a2752 i915g: Fix void ptr arith 2011-02-21 00:50:16 +01:00
Marek Olšák e9e5380f22 r300g: fix invalid dereference in winsys
radeon_bo_unref may destroy the buffer, so call it after p_atomic_dec, not before.
2011-02-19 00:06:52 +01:00
Marek Olšák fa3f1348e4 r300g: fix a race between CS and SET_TILING ioctls 2011-02-16 22:23:23 +01:00
Marek Olšák b9e2cde600 r300g: offload the CS ioctl to another thread
This is a multi-threading optimization which hides the kernel overhead
behind a thread. It improves performance in CPU-limited apps by 2-15%.
Of course you must have at least 2 cores for it to make any difference.

It can be disabled with:

export RADEON_THREAD=0
2011-02-15 09:17:39 +01:00
Marek Olšák 333d3daf47 r300g: actually implement the is_buffer_busy hook the right way
Ooops.
2011-02-15 04:00:47 +01:00
Marek Olšák 45e1cd522b r300g: handle interaction between UNSYNCHRONIZED and DONTBLOCK flags in bo_map
The VBO module uses both, but they are somewhat opposite to each other.
In this case, we pick UNSYNCHRONIZED and ignore DONTBLOCK.
2011-02-15 04:00:47 +01:00
Marek Olšák 8decb0a96d r300g: fix a possible race condition when mapping a buffer
This is the last one I think.
2011-02-15 04:00:47 +01:00
Marek Olšák 89ee0d527c r300g: flush CS in bo_map even if we get USAGE_DONTBLOCK
Because an app may do something like this:

while (!(ptr = bo_map(..., DONT_BLOCK))) {
    /* Do some other work. */
}

And it would be looping endlessly if we didn't flush.
2011-02-14 23:34:45 +01:00
Marek Olšák a87730ff3f r300g: implement pb_manager::is_buffer_busy 2011-02-14 22:02:40 +01:00
Marek Olšák 8ab1fcc66a r300g: fixup the handle_compare function
Accidentally negated in 685c3262b9.
2011-02-13 00:31:04 +01:00
Marek Olšák 685c3262b9 r300g: typecast void* to unsigned correctly 2011-02-12 23:36:48 +01:00
Marek Olšák df54b53b7d r300g: improve function radeon_bo_is_referenced_by_cs
This should prevent calling into radeon_get_reloc when there's
only one context.
2011-02-12 03:08:39 +01:00
Marek Olšák de22d8f1ee r300g: remove unused function prototypes, update copyright 2011-02-11 06:07:23 +01:00
Marek Olšák 032b162ce8 r300g: plug a memory leak in winsys 2011-02-11 02:34:15 +01:00
Marek Olšák 862ebb411b r300g: remove unneeded code in winsys
We don't need the read/write flags.
2011-02-11 01:32:44 +01:00
Marek Olšák 6ccab620a0 r300g: import the last bits of libdrm and cleanup the whole thing
Based on Dave's branch.

The majority of this commit is a cleanup, mainly renaming things.
There wasn't much code to import, just ioctl calls.

Also done:
- implemented unsynchronized bo_map (important optimization!)
- radeon_bo_is_referenced_by_cs is no longer a refcount hack
- dropped the libdrm_radeon dependency

I'm surprised that this has resulted in less code in the end.
2011-02-11 01:07:25 +01:00
Brian Paterni 4d78dafc84 r600g: silence a few valgrind warnings 2011-02-08 12:48:44 +01:00
Henri Verbeet a6a710cbe7 r600g: Make some more things static. 2011-02-03 21:13:12 +01:00
José Fonseca 637ed52f59 svga/drm: Flushing preemptively on a 1/3 of the aperture.
Exactly one half would be the ideal, but this is a soft limit, and one
more byte over brings us to synchronous behavior.

Flushing when the referred GMR exceeds one third of the aperture gives us
statistically better performance.
2011-02-03 15:15:23 +00:00
José Fonseca 63c0a504a0 svga/drm: Update for pb_vtbl::map argument addition. 2011-02-03 15:15:23 +00:00
Dave Airlie a112cc283d r600g: align the tiling modes with what the DDX and kernel expects.
If we see a MACRO bit on r600g its 2D tiled,
if don't see a MACRO bit and we do see a MICRO bit then its 1D tiled.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-01 14:23:35 +10:00
Dave Airlie 42b5f68198 r600g: start looking at evergreen tiling.
this just adds the ioctl interface and sets the tile type
and array mode in the correct place.

This seems to bring eg 1D tiling to the same level, and issues
as on r600. No idea how to address 2D yet.
2011-02-01 10:36:57 +10:00
Vinson Lee 8c115aa247 scons: Gracefully handle pkg-config errors with libdrm_radeon.
Print warnings and continue build.
2011-01-31 10:50:06 -08:00
Dave Airlie ea5ede2178 r600g: fix eg OQ properly.
the context init is separate for these gpus.
2011-01-31 20:44:47 +10:00
Alex Deucher 26a4c1cb65 r600g: fix OQ on evergreen
6xx/7xx have a max of 4 DBs, evergreen have a max of 8.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-01-31 02:49:27 -05:00
Dave Airlie df8089df90 r600g: fix occlusion query results.
Like on some r5xx, there are multiple DB backends on the r600,
we need to add up the query results from each of these to get the
final correct value.

So far I'm not 100% sure how to calculate the num_db, value
setting it to 4 should be harmless enough until we do.

This fixes occulsion_query piglit test on my rv740.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-01-31 16:14:03 +10:00
Marek Olšák 82e60236a9 r300g: print driver info if RADEON_DEBUG=info 2011-01-27 23:17:41 +01:00
Marek Olšák 39f16e2aa7 r300g: add winsys flag CAN_AACOMPRESS 2011-01-27 23:13:28 +01:00
Marek Olšák 2e3ccada07 r300g: rename flag squaretiling -> drm_2_1_0 2011-01-27 23:06:15 +01:00
Mathias Fröhlich 90c2fd8640 r600g: Implement timer queries. 2011-01-25 14:18:19 -05:00
Mathias Fröhlich e7ec532735 r600g: Implement asyncronous query results. 2011-01-25 14:18:19 -05:00
Mathias Fröhlich b55fd961e1 r600g: Fix meaning of num_results for queries. 2011-01-25 14:18:19 -05:00
Tim Wiederhake 4102c7c7e2 fix potential leak in r600_context_init 2011-01-25 14:18:19 -05:00
Tim Wiederhake 9d41e5ee46 silences some valgrind warnings
==5547== Conditional jump or move depends on uninitialised value(s)
==5547==    at 0x8FE745D: r600_drm_winsys_create (r600_drm.c:86)
2011-01-25 14:18:19 -05:00
Christian König 78faf8d0e9 Merge remote branch 'origin/master' into pipe-video
Conflicts:
	src/gallium/drivers/r600/r600_asm.c
2011-01-20 22:43:18 +01:00
Christian König d2ff6b8715 Merge remote branch 'origin/master' into pipe-video
Conflicts:
	src/gallium/drivers/r600/r600_asm.c
	src/gallium/drivers/r600/r600_shader.c
2011-01-20 22:10:37 +01:00
Henri Verbeet 9e964baaf3 r600g: Kill trailing whitespace. 2011-01-18 20:57:04 +01:00
Henri Verbeet a25473b535 r600g: Remove the redundant radeon_new() prototype. 2011-01-15 19:48:43 +01:00
Christian König a96fe679e2 Merge remote branch 'origin/master' into pipe-video
Conflicts:
	src/gallium/drivers/r600/r600_shader.c
2011-01-12 00:48:10 +01:00
Jerome Glisse 63b9790a55 r600g: move user fence into base radeon structure
This avoid any issue when context is free and we still try to
access fence through radeon structure.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2011-01-11 14:34:25 -05:00
Christian König 1b1c15a54a r600g: place buffers into different domains, based on usage flags 2011-01-10 22:09:41 +01:00
Dave Airlie 3ee8d13c00 i965g: update disassembler code from classic.
still a bit of work to do, the winsys gen setting is a bit of a hack.
2011-01-09 17:21:10 +10:00
Christian König 72e3099155 Merge remote branch 'origin/master' into pipe-video
Conflicts:
	configure.ac
	src/gallium/drivers/r600/eg_asm.c
	src/gallium/drivers/r600/r600_asm.c
	src/gallium/drivers/r600/r600_asm.h
	src/gallium/include/pipe/p_format.h
	src/gallium/targets/dri-nouveau/Makefile
2011-01-08 13:24:36 +01:00
Marek Olšák 1f0348c4a2 r300g: rework command submission and resource space checking
The motivation behind this rework is to get some speed by reducing
CPU overhead. The performance increase depends on many factors,
but it's measurable (I think it's about 10% increase in Torcs).

This commit replaces libdrm's radeon_cs_gem with our own implemention.
It's optimized specifically for r300g, but r600g could use it as well.
Reloc writes and space checking are faster and simpler than their
counterparts in libdrm (the time complexity of all the functions
is O(1) in nearly all scenarios, thanks to hashing).
(libdrm's radeon_bo_gem is still being used in the driver.)

It works like this:

cs_add_reloc(cs, buf, read_domain, write_domain) adds a new relocation and
also adds the size of 'buf' to the used_gart and used_vram winsys variables
based on the domains, which are simply or'd for the accounting purposes.
The adding is skipped if the reloc is already present in the list, but it
accounts any newly-referenced domains.

cs_validate is then called, which just checks:
    used_vram/gart < vram/gart_size * 0.8
The 0.8 number allows for some memory fragmentation. If the validation
fails, the pipe driver flushes CS and tries do the validation again,
i.e. it validates only that one operation. If it fails again, it drops
the operation on the floor and prints some nasty message to stderr.

cs_write_reloc(cs, buf) just writes a reloc that has been added using
cs_add_reloc. The read_domain and write_domain parameters have been removed,
because we already specify them in cs_add_reloc.

The space checking has been tested by putting small values in vram/gart_size
variables.
2011-01-08 07:05:42 +01:00
Alex Deucher f54366bcf6 r600g: add support for NI (Northern Islands) GPUs
This adds support for Barts, Turks, and Caicos asics.
2011-01-06 18:05:16 -05:00
Christoph Bumiller cd1cf78828 Merge remote branch 'origin/nvc0' 2011-01-04 18:20:05 +01:00
Christian König e179a8bf34 Merge remote branch 'origin/master' into pipe-video 2010-12-22 21:12:24 +01:00
Henri Verbeet 2fd718d560 r600g: r600_new() and r600_delete() are unused. 2010-12-22 09:19:48 +01:00
Alex Deucher 341d048e45 r600g: remove useless switch statements
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2010-12-22 01:30:41 -05:00
Dave Airlie f431e0452b r600g: drop unused code in evergreen.
this code was pretty much duplicated, thanks to Henri Verbeet on irc for
pointing it out.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-12-22 15:58:29 +10:00
Marek Olšák 2a95542088 r300g: support B10G10R10A2 render targets only with DRM 2.8.0 or later versions 2010-12-22 03:39:37 +01:00
Christoph Bumiller 0f68236a24 Merge remote branch 'origin/master' into nvc0-new 2010-12-19 21:46:33 +01:00
Jakob Bornecrantz c28debbf6f svga: Remove debug print in winsys 2010-12-16 09:44:02 +01:00
Jakob Bornecrantz 0967d77a9a wrapper: Flush pipe on unmap
For drivers that does DMA transfers instead of mapping directly
2010-12-16 08:53:26 +01:00
Jakob Bornecrantz 8b60bf4e9f wrapper: Fix width and height given to map and remove uneeded fields 2010-12-16 08:53:26 +01:00
Vinson Lee 075a807f43 r300g: Remove unnecessary header. 2010-12-23 16:05:28 -08:00
Christian König 772b25e1f3 Merge remote branch 'origin/master' into pipe-video
Conflicts:
	src/gallium/drivers/r600/r600_pipe.c
	src/gallium/drivers/r600/r600_texture.c
2010-12-11 13:43:44 +01:00
Jerome Glisse b22c8e8bbc r600g: fix bo size when creating bo from handle
Spoted by Alex Diomin

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-12-10 11:17:27 -05:00
Vinson Lee af5f7b3260 r600g: Fix SCons build. 2010-12-09 14:03:58 -08:00
Jerome Glisse 15753cf54d r600g: avoid using pb* helper we are loosing previous cpu cycle with it
r600g is up to a point where all small CPU cycle matter and pb* turn
high on profile. It's mostly because pb try to be generic and thus
trigger unecessary check for r600g driver. To avoid having too much
abstraction & too much depth in the call embedded everythings into
r600_bo. Make code simpler & faster. The performance win highly depend
on the CPU & application considered being more important on slower CPU
and marginal/unoticeable on faster one.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-12-09 16:07:01 -05:00
Jerome Glisse b7617346dc r600g: fix userspace fence against lastest kernel
R6XX GPU doesn't like to have two partial flush writting
back to memory in row without a prior flush of the pipeline.
Add PS_PARTIAL_FLUSH to flush all work between the CP and
the ES, GS, VS, PS shaders.

Thanks a lot to Alban Browaeys (prahal on irc) for investigating
this issue.

Signed-off-by: Alban Browaeys <prahal@yahoo.com>
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-12-07 17:54:56 -05:00
Jerome Glisse e0d554ab78 r600g: remove useless flush map
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-12-06 15:50:50 -05:00
Henri Verbeet 308cfb80f5 r600g: Cleanup block bo references in r600_context_fini(). 2010-12-05 18:44:44 +01:00
Marek Olšák 6947e52548 r300g: cleanup winsys 2010-12-05 05:47:10 +01:00
Jerome Glisse edda44e0dc r600g: more indentation fix + warning silencing + dead code removal
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-12-03 13:06:53 -05:00
Marek Olšák 3ba8843307 r300g: use internal BO handle for add_buffer and write_reloc
Small perf improvement in ipers.

radeon_drm_get_cs_handle is exactly what this commit tries to avoid
in every write_reloc.
2010-12-03 04:40:22 +01:00
Roland Scheidegger 4c70014626 gallium: support for array textures and related changes
resources have a array_size parameter now.
get_tex_surface and tex_surface_destroy have been renamed to create_surface
and surface_destroy and moved to context, similar to sampler views (and
create_surface now uses a template just like create_sampler_view). Surfaces
now really should only be used for rendering. In particular they shouldn't be
used as some kind of 2d abstraction for sharing a texture. offset/layout fields
don't make sense any longer and have been removed, width/height should go too.
surfaces and sampler views now specify a layer range (for texture resources),
layer is either array slice, depth slice or cube face.
pipe_subresource is gone array slices (or cube faces) are now treated the same
as depth slices in transfers etc. (that is, they use the z coord of the
respective functions).

Squashed commit of the following:

commit a45bd509014743d21a532194d7b658a1aeb00cb7
Merge: 1aeca28 32e1e59
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Dec 2 04:32:06 2010 +0100

    Merge remote branch 'origin/master' into gallium-array-textures

    Conflicts:
    	src/gallium/drivers/i915/i915_resource_texture.c
    	src/gallium/drivers/i915/i915_state_emit.c
    	src/gallium/drivers/i915/i915_surface.c

commit 1aeca287a827f29206078fa1204715a477072c08
Merge: 912f042 6f7c8c3
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Dec 2 00:37:11 2010 +0100

    Merge remote branch 'origin/master' into gallium-array-textures

    Conflicts:
    	src/gallium/state_trackers/vega/api_filters.c
    	src/gallium/state_trackers/vega/api_images.c
    	src/gallium/state_trackers/vega/mask.c
    	src/gallium/state_trackers/vega/paint.c
    	src/gallium/state_trackers/vega/renderer.c
    	src/gallium/state_trackers/vega/st_inlines.h
    	src/gallium/state_trackers/vega/vg_context.c
    	src/gallium/state_trackers/vega/vg_manager.c

commit 912f042e1d439de17b36be9a740358c876fcd144
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Dec 1 03:01:55 2010 +0100

    gallium: even more compile fixes after merge

commit 6fc95a58866d2a291def333608ba9c10c3f07e82
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Dec 1 00:22:26 2010 +0100

    gallium: some fixes after merge

commit a8d5ffaeb5397ffaa12fb422e4e7efdf0494c3e2
Merge: f7a202f 2da02e7
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Nov 30 23:41:26 2010 +0100

    Merge remote branch 'origin/master' into gallium-array-textures

    Conflicts:
    	src/gallium/drivers/i915/i915_state_emit.c
    	src/gallium/state_trackers/vega/api_images.c
    	src/gallium/state_trackers/vega/vg_context.c

commit f7a202fde2aea2ec78ef58830f945a5e214e56ab
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Nov 24 19:19:32 2010 +0100

    gallium: even more fixes/cleanups after merge

commit 6895a7f969ed7f9fa8ceb788810df8dbcf04c4c9
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Nov 24 03:07:36 2010 +0100

    gallium: more compile fixes after merge

commit af0501a5103b9756bc4d79167bd81051ad6e8670
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Nov 23 19:24:45 2010 +0100

    gallium: lots of compile fixes after merge

commit 0332003c2feb60f2a20e9a40368180c4ecd33e6b
Merge: 26c6346 b6b91fa
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Nov 23 17:02:26 2010 +0100

    Merge remote branch 'origin/master' into gallium-array-textures

    Conflicts:
    	src/gallium/auxiliary/gallivm/lp_bld_sample.c
    	src/gallium/auxiliary/util/u_blit.c
    	src/gallium/auxiliary/util/u_blitter.c
    	src/gallium/auxiliary/util/u_inlines.h
    	src/gallium/auxiliary/util/u_surface.c
    	src/gallium/auxiliary/util/u_surfaces.c
    	src/gallium/docs/source/context.rst
    	src/gallium/drivers/llvmpipe/lp_rast.c
    	src/gallium/drivers/nv50/nv50_state_validate.c
    	src/gallium/drivers/nvfx/nv04_surface_2d.c
    	src/gallium/drivers/nvfx/nv04_surface_2d.h
    	src/gallium/drivers/nvfx/nvfx_buffer.c
    	src/gallium/drivers/nvfx/nvfx_miptree.c
    	src/gallium/drivers/nvfx/nvfx_resource.c
    	src/gallium/drivers/nvfx/nvfx_resource.h
    	src/gallium/drivers/nvfx/nvfx_state_fb.c
    	src/gallium/drivers/nvfx/nvfx_surface.c
    	src/gallium/drivers/nvfx/nvfx_transfer.c
    	src/gallium/drivers/r300/r300_state_derived.c
    	src/gallium/drivers/r300/r300_texture.c
    	src/gallium/drivers/r600/r600_blit.c
    	src/gallium/drivers/r600/r600_buffer.c
    	src/gallium/drivers/r600/r600_context.h
    	src/gallium/drivers/r600/r600_screen.c
    	src/gallium/drivers/r600/r600_screen.h
    	src/gallium/drivers/r600/r600_state.c
    	src/gallium/drivers/r600/r600_texture.c
    	src/gallium/include/pipe/p_defines.h
    	src/gallium/state_trackers/egl/common/egl_g3d_api.c
    	src/gallium/state_trackers/glx/xlib/xm_st.c
    	src/gallium/targets/libgl-gdi/gdi_softpipe_winsys.c
    	src/gallium/targets/libgl-gdi/libgl_gdi.c
    	src/gallium/tests/graw/tri.c
    	src/mesa/state_tracker/st_cb_blit.c
    	src/mesa/state_tracker/st_cb_readpixels.c

commit 26c6346b385929fba94775f33838d0cceaaf1127
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Aug 2 19:37:21 2010 +0200

    fix more merge breakage

commit b30d87c6025eefe7f6979ffa8e369bbe755d5c1d
Merge: 9461bf3 1f1928d
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Aug 2 19:15:38 2010 +0200

    Merge remote branch 'origin/master' into gallium-array-textures

    Conflicts:
    	src/gallium/drivers/llvmpipe/lp_rast.c
    	src/gallium/drivers/llvmpipe/lp_rast_priv.h
    	src/gallium/drivers/r300/r300_blit.c
    	src/gallium/drivers/r300/r300_screen_buffer.c
    	src/gallium/drivers/r300/r300_state_derived.c
    	src/gallium/drivers/r300/r300_texture.c
    	src/gallium/drivers/r300/r300_texture.h
    	src/gallium/drivers/r300/r300_transfer.c
    	src/gallium/drivers/r600/r600_screen.c
    	src/gallium/drivers/r600/r600_state.c
    	src/gallium/drivers/r600/r600_texture.c
    	src/gallium/drivers/r600/r600_texture.h
    	src/gallium/state_trackers/dri/common/dri1_helper.c
    	src/gallium/state_trackers/dri/sw/drisw.c
    	src/gallium/state_trackers/xorg/xorg_exa.c

commit 9461bf3cfb647d2301364ae29fc3084fff52862a
Merge: 17492d7 0eaccb3
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Jul 15 20:13:45 2010 +0200

    Merge commit 'origin/master' into gallium-array-textures

    Conflicts:
    	src/gallium/auxiliary/util/u_blitter.c
    	src/gallium/drivers/llvmpipe/lp_rast.c
    	src/gallium/drivers/llvmpipe/lp_surface.c
    	src/gallium/drivers/r300/r300_render.c
    	src/gallium/drivers/r300/r300_state.c
    	src/gallium/drivers/r300/r300_texture.c
    	src/gallium/drivers/r300/r300_transfer.c
    	src/gallium/tests/trivial/quad-tex.c

commit 17492d705e7b7f607b71db045c3bf344cb6842b3
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Fri Jun 18 10:58:08 2010 +0100

    gallium: rename element_offset/width fields in views to first/last_element

    This is much more consistent with the other fields used there
    (first/last level, first/last layer).
    Actually thinking about removing the ugly union/structs again and
    rename first/last_layer to something even more generic which could also
    be used for buffers (like first/last_member) without inducing headaches.

commit 1b717a289299f942de834dcccafbab91361e20ab
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Jun 17 14:46:09 2010 +0100

    gallium: remove PIPE_SURFACE_LAYOUT_LINEAR definition

    This was only used by the layout field of pipe_surface, but this
    driver internal stuff is gone so there's no need for this driver independent
    layout definition neither.

commit 10cb644b31b3ef47e6c7b55e514ad24bb891fac4
Merge: 5691db9 c85971d
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Jun 17 12:20:41 2010 +0100

    Merge commit 'origin/master' into gallium-array-textures

    Conflicts:
    	src/gallium/docs/source/glossary.rst
    	src/gallium/tests/graw/fs-test.c
    	src/gallium/tests/graw/gs-test.c

commit 5691db960ca3d525ce7d6c32d9c7a28f5e907f3b
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Jun 17 11:29:03 2010 +0100

    st/wgl: fix interface changes bugs

commit 2303ec32143d363b46e59e4b7c91b0ebd34a16b2
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Jun 16 19:42:32 2010 +0100

    gallium: adapt code to interface changes...

commit dcae4f586f0d0885b72674a355e5d56d47afe77d
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Jun 16 19:42:05 2010 +0100

    gallium: separate depth0 and array_size in the resource itself.

    These fields are still mutually exclusive (since no 3d array textures exist)
    but it ultimately seemed to error-prone to adapt all code accept the new
    meaning of depth0 (drivers stick that into hardware regs, calculate mipmap
    sizes etc.). And it isn't really cleaner anyway.
    So, array textures will have depth0 of 1, but instead use array_size,
    3D textures will continue to use depth0 (and have array_size of 1). Cube
    maps also will use array_size to indicate their 6 faces, but since all drivers
    should just be fine by inferring this themselves from the fact it's a cube map
    as they always used to nothing should break.

commit 621737a638d187d208712250fc19a91978fdea6b
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Jun 16 17:47:38 2010 +0100

    gallium: adapt code to interface changes

    There are still usages of pipe_surface where pipe_resource should be used,
    which should eventually be fixed.

commit 2d17f5efe166b2c3d51957c76294165ab30b8ae2
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Jun 16 17:46:14 2010 +0100

    gallium: more interface changes

    In particular to enable usage of buffers in views, and ability to use a
    different pipe_format in pipe_surface.
    Get rid of layout and offset parameter in pipe_surface - the former was
    not used in any (public) code anyway, and the latter should either be computed
    on-demand or driver can use subclass of pipe_surface.
    Also make create_surface() use a template to be more consistent with
    other functions.

commit 71f885ee16aa5cf2742c44bfaf0dc5b8734b9901
Merge: 3232d11 8ad410d
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Jun 14 14:19:51 2010 +0100

    Merge commit 'origin/master' into gallium-array-textures

    Conflicts:
    	src/gallium/auxiliary/util/u_box.h
    	src/gallium/drivers/nv50/nv50_surface.c
    	src/gallium/drivers/nvfx/nvfx_surface.c
    	src/gallium/drivers/r300/r300_blit.c
    	src/gallium/drivers/r300/r300_texture.c
    	src/gallium/drivers/r300/r300_transfer.c
    	src/gallium/drivers/r600/r600_blit.c
    	src/gallium/drivers/r600/r600_screen.h
    	src/gallium/include/pipe/p_state.h

commit 3232d11fe3ebf7686286013c357b404714853984
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Jun 14 11:40:04 2010 +0100

    mesa/st: adapt to interface changes

    still need to fix pipe_surface sharing
    (as that is now per-context).
    Also broken is depth0 handling - half the code assumes
    this is also used for array textures (and hence by extension
    of that cube maps would have depth 6), half the code does not...

commit f433b7f7f552720e5eade0b4078db94590ee85e1
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Jun 14 11:35:52 2010 +0100

    gallium: fix a couple of bugs in interface chnage fixes

commit 818366b28ea18f514dc791646248ce6f08d9bbcf
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:42:11 2010 +0200

    targets: adapt to interface changes

    Yes even that needs adjustments...

commit 66c511ab1682c9918e0200902039247793acb41e
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:41:13 2010 +0200

    tests: adapt to interface changes

    Everything needs to be fixed :-(.

commit 6b494635d9dbdaa7605bc87b1ebf682b138c5808
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:39:50 2010 +0200

    st: adapt non-rendering state trackers to interface changes

    might not be quite right in all places, but they really don't want
    to use pipe_surface.

commit 00c4289a35d86e4fe85919ec32aa9f5ffe69d16d
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:38:48 2010 +0200

    winsys: adapt to interface changes

commit 39d858554dc9ed5dbc795626fec3ef9deae552a0
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:26:54 2010 +0200

    st/python: adapt to interface changes

    don't think that will work, sorry.

commit 6e9336bc49b32139cec4e683857d0958000e15e3
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:26:07 2010 +0200

    st/vega: adapt to interface changes

commit e07f2ae9aaf8842757d5d50865f76f8276245e11
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:25:56 2010 +0200

    st/xorg: adapt to interface changes

commit 05531c10a74a4358103e30d3b38a5eceb25c947f
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:24:53 2010 +0200

    nv50: adapt to interface changes

commit 97704f388d7042121c6d496ba8c003afa3ea2bf3
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:24:45 2010 +0200

    nvfx: adapt to interface changes

commit a8a9c93d703af6e8f5c12e1cea9ec665add1abe0
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:24:01 2010 +0200

    i965g: adapt to interface changes

commit 0dde209589872d20cc34ed0b237e3ed7ae0e2de3
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:22:38 2010 +0200

    i915g: adapt to interface changes

commit 5cac9beede69d12f5807ee1a247a4c864652799e
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:20:58 2010 +0200

    svga: adapt to interface changes

    resource_copy_region still looking fishy.
    Was not very suited to unified zslice/face approach...

commit 08b5a6af4b963a3e4c75fc336bf6c0772dce5150
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:20:01 2010 +0200

    rbug: adapt to interface changes

    Not sure if that won't need changes elsewhere?

commit c9fd24b1f586bcef2e0a6e76b68e40fca3408964
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:19:31 2010 +0200

    trace: adapt to interface changes

commit ed84e010afc5635a1a47390b32247a266f65b8d1
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:19:21 2010 +0200

    failover: adapt to interface changes

commit a1d4b4a293da933276908e3393435ec4b43cf201
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:19:12 2010 +0200

    identity: adapt to interface changes

commit a8dd73e2c56c7d95ffcf174408f38f4f35fd2f4c
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:18:55 2010 +0200

    softpipe: adapt to interface changes

commit a886085893e461e8473978e8206ec2312b7077ff
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:18:44 2010 +0200

    llvmpipe: adapt to interface changes

commit 70523f6d567d8b7cfda682157556370fd3c43460
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:18:14 2010 +0200

    r600g: adapt to interface changes

commit 3f4bc72bd80994865eb9f6b8dfd11e2b97060d19
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:18:05 2010 +0200

    r300g: adapt to interface changes

commit 5d353b55ee14db0ac0515b5a3cf9389430832c19
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:17:37 2010 +0200

    cell: adapt to interface changes

    not even compile tested

commit cf5d03601322c2dcb12d7a9c2f1745e2b2a35eb4
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:14:59 2010 +0200

    util: adapt to interface changes

    amazing how much code changes just due to some subtle interface changes?

commit dc98d713c6937c0e177fc2caf23020402cc7ea7b
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:12:40 2010 +0200

    gallium: more interface fail, docs

    this also changes flush_frontbuffer to use a pipe_resource instead of
    a pipe_surface - pipe_surface is not meant to be (or at least no longer)
    an abstraction for standalone 2d images which get passed around.
    (This has also implications for the non-rendering state-trackers.)

commit 08436d27ddd59857c22827c609b692aa0c407b7b
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Jun 10 17:42:52 2010 +0200

    gallium: fix array texture interface changes bugs, docs

commit 4a4d927609b62b4d7fb9dffa35158afe282f277b
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Jun 3 22:02:44 2010 +0200

    gallium: interface changes for array textures and related cleanups

    This patch introduces array textures to gallium (note they are not immediately
    usable without the associated changes to the shader side).
    Also, this abandons pipe_subresource in favor of using level and layer
    parameters since the distinction between several faces (which was part of
    pipe_subresource for cube textures) and several z slices (which were not part
    of pipe_subresource but instead part of pipe_box where appropriate for 3d
    textures) is gone at the resource level.
    Textures, be it array, cube, or 3d, now use a "unified" set of parameters,
    there is no distinction between array members, cube faces, or 3d zslices.
    This is unlike d3d10, whose subresource index includes layer information for
    array textures, but which considers all z slices of a 3d texture to be part
    of the same subresource.
    In contrast to d3d10, OpenGL though reuses old 2d and 3d function entry points
    for 1d and 2d array textures, respectively, which also implies that for instance
    it is possible to specify all layers of a 2d array texture at once (note that
    this is not possible for cube maps, which use the 2d entry points, although
    it is possible for cube map arrays, which aren't supported yet in gallium).
    This should possibly make drivers a bit simpler, and also get rid of mutually
    exclusive parameters in some functions (as z and face were exclusive), one
    potential downside would be that 3d array textures could not easily be supported
    without reverting this, but those are nowhere to be seen.

    Also along with adjusting to new parameters, rename get_tex_surface /
    tex_surface_destroy to create_surface / surface_destroy and move them from
    screen to context, which reflects much better what those do (they are analogous
    to create_sampler_view / sampler_view_destroy).

    PIPE_CAP_ARRAY_TEXTURES is used to indicate if a driver supports all of this
    functionality (that is, both sampling from array texture as well as use a range
    of layers as a render target, with selecting the layer from the geometry shader).
2010-12-02 04:33:43 +01:00
Chris Wilson f6476822a0 i915g: Fix closure of full batch buffers
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
[danvet: incorporate comments by Dr_Jakob]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2010-12-02 01:34:14 +01:00
Daniel Vetter 2ff0879a63 i915g: return tiling in iws->buffer_from_handle
This is needed to properly implement tiling flags. And the gem
implemention fo buffer_from_handle already calls get_tiling, so
it's for free.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2010-12-02 01:34:13 +01:00
Daniel Vetter 135b083461 i915g: prepare winsys/batchbuffer for execbuf2
Wire up a fenced parameter, switch all relocations to _FENCED

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2010-12-02 01:34:13 +01:00
Daniel Vetter 1c60840338 i915g: switch to tiled allocations, kill set_fence
This way relaxed fencing is handled by libdrm. And buffers _can't_
ever change their tiling.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2010-12-02 01:34:13 +01:00
Daniel Vetter 4a666488c4 i915g: add winsys function to create tiled buffers
Different kernels have different restrictions for tiled buffers.
Hence use the libdrm abstraction to calculate the necessary
stride and height alignment requirements.

Not yet used.

v2: Incorporate review comments from Jakob Bornecrantz

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2010-12-02 01:34:12 +01:00
Daniel Vetter c62f5c7e7b i915g: drop alignment parameter from iws->buffer_create
It's unnecessary. The kernel gem ignores it totally and we can't
run on the old userspace fake bo manager due to lack of dri2.

Also drop the redundant name string from the sw winsys as suggested
by Jakob Bornecrantz

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2010-12-02 01:34:12 +01:00
Dave Airlie 3b5a3fd8d1 r300g/r600g: bump cache manager timeouts to 1s
On lightsmark on my r500 this drop the bufmgr allocations of the sysprof.
2010-11-25 09:18:19 +10:00
Alex Deucher ed8b5fb24e gallium/egl: fix r300 vs r600 loading
Should fix:
https://bugs.freedesktop.org/show_bug.cgi?id=31841
2010-11-23 15:18:31 -05:00
Alex Deucher 0e4c5f63b9 r600g: add support for ontario APUs
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2010-11-22 18:01:26 -05:00
Alex Deucher 271b7b5914 r600g: fix some winsys functions to deal properly with evergreen
Are these functions actually used anywhere?
2010-11-22 17:39:54 -05:00
Alex Deucher bf9c80976f r600g: fix additional EVENT_WRITE packet
Add explicit EVENT_TYPE field
2010-11-22 17:39:16 -05:00
Christian König e6b71530da Merge remote branch 'origin/master' into pipe-video
Conflicts:
	src/gallium/auxiliary/Makefile
	src/gallium/auxiliary/SConscript
2010-11-21 19:40:52 +01:00
Daniel Vetter c8fca58d9d i915g: kill idws->pool
The drm winsys only ever handles one gem memory manager. Rip out
the unnecessary complication.

Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2010-11-21 16:41:19 +01:00
Daniel Vetter e182618853 i915g: kill buf->map_gtt
Not using the gtt is considered harmful for performance. And for
partial uploads there's always drm_intel_bo_subdata.

Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2010-11-21 16:41:19 +01:00
Jerome Glisse f609b2ab03 r600g: add fetch shader capabilities
Use fetch shader instead of having fetch instruction in the vertex
shader. Allow to restrict shader update to a smaller part when
vertex buffer input layout changes.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-11-19 13:40:55 -05:00
Alex Deucher 3e76ed4e25 r600g: All EVENT_WRITE packets need the EVENT_INDEX field
6xx-evergreen
2010-11-19 13:35:53 -05:00
Jerome Glisse fab804bdfe r600g: fix occlusion query on evergreen (avoid lockup)
Occlusion query on evergreen need the event index field to be
set otherwise we endup locking up the GPU.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-11-19 11:53:01 -05:00
Alex Deucher a23f25eba1 r600g: fix buffer alignment
This should fix the remaining buffer alignment issues in r600g.
2010-11-17 21:33:40 -05:00
Henri Verbeet da8c877733 r600g: Cleanup the fenced_bo list in r600_context_fini(). 2010-11-15 22:20:12 +01:00
Christoph Bumiller 4c22475383 nvc0: import nvc0 gallium driver 2010-11-12 15:17:40 +01:00
Christian König 195bbe8ce2 Merge remote branch 'origin/master' into pipe-video 2010-11-11 21:07:42 +01:00
Jerome Glisse 8e0230a85c r600g: allow driver to work without submitting cmd to GPU
For driver performance analysis it usefull to be able to
disable as much as possible the GPU interaction so that
one can profile the userspace only.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-11-10 16:49:50 -05:00
Keith Whitwell 9a04eca2f8 ws/r600: match bo_busy shared/fence logic in bo_wait
Fixes crash in piglit depthrange-clear.
2010-11-10 11:04:38 +00:00
Vinson Lee 520140a6c9 winsys/xlib: Add cygwin to SConscript.
Fixes SCons NameError exception on Cygwin.
2010-11-09 12:31:11 -08:00
Benjamin Franzke 46c1970067 r600g: implement texture_get_handle (needed for eglExportDRMImageMESA) 2010-11-08 13:44:54 -05:00
Jakob Bornecrantz b4ac0adb75 scons: Detabify
Drivers scons files for a later time
2010-11-05 20:58:49 +00:00
Keith Whitwell c3974dc837 r600g: set hardware pixel centers according to gl_rasterization_rules
These were previously being left in the default (D3D) mode.  This mean
that triangles were drawn slightly incorrectly, but also because this
state is relied on by the u_blitter code, all blits were half a pixel
off.
2010-11-03 09:36:01 +00:00
Keith Whitwell 29c4a15bf6 r600g: propogate resource usage flags to winsys, use to choose bo domains
This opens the question of what interface the winsys layer should
really have for talking about these concepts.

For now I'm using the existing gallium resource usage concept, but
there is no reason not use terms closer to what the hardware
understands - eg. the domains themselves.
2010-11-03 09:36:01 +00:00
Tilman Sauerbeck 907efeea18 r600g: Fixed two memory leaks in winsys.
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-11-02 21:52:39 +01:00
Tilman Sauerbeck 86778dadc5 r600g: Made radeon_bo::map_count signed.
That way assert(map_count >= 0) can actually fail when we screwed up.

Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-11-02 21:52:39 +01:00
Tilman Sauerbeck 34e75b0ca8 r600g: Fixed unmap condition in radeon_bo_pb_destroy().
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-11-02 21:52:38 +01:00
Tilman Sauerbeck b675266f0e r600g: Made radeon_bo_pb_map_internal() actually call radeon_bo_map().
This ensures that we increase bo->map_count when radeon_bo_map_internal()
returns successfully, which in turn makes sure we don't decrement
bo->map_count below zero later.

Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-11-02 21:52:38 +01:00
Tilman Sauerbeck 4e34393162 r600g: Removed unused 'ptr' argument from radeon_bo().
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-11-02 21:52:38 +01:00
José Fonseca 601498ae73 scons: Revamp how to specify targets to build.
Use scons target and dependency system instead of ad-hoc options.

Now is simply a matter of naming what to build. For example:

  scons libgl-xlib

  scons libgl-gdi

  scons graw-progs

  scons llvmpipe

and so on. And there is also the possibility of scepcified subdirs, e.g.

  scons src/gallium/drivers

If nothing is specified then everything will be build.

There might be some rough corners over the next days. Please bare with me.
2010-11-01 13:30:22 +00:00
Christian König 41ed47d6b8 Merge branch 'master' of ssh://git.freedesktop.org/git/mesa/mesa into pipe-video
Conflicts:
	src/gallium/include/pipe/p_format.h
2010-10-28 20:24:56 +02:00
Tilman Sauerbeck c6b10cd986 r600g: In radeon_bo(), call LIST_INITHEAD early.
radeon_bo_destroy() will want to read the list field. Without this patch,
we'd end up evaluating the list pointers before they have been properly
set up when we destroyed the newly created bo if it cannot be mapped.

Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-10-27 08:44:35 +02:00
Christian König ba9caba9c8 Some more merge fixes 2010-10-23 13:54:47 +02:00
Dave Airlie 39c742fe2a r600g: not fatal if we can't get tiling info from kernel 2010-10-23 07:45:59 +10:00
Brian Paul aa86c7657c winsys/xlib: rename xm->xlib
Move away from the old Mesa-oriented names.
2010-10-21 19:55:03 -06:00
Brian Paul 3bc6fe371c winsys/xlib: fix up allocation/dealloction of XImage
Fixes a crash upon exit when using remote display.
2010-10-21 19:49:34 -06:00
Brian Paul 4d24f01cb3 winsys/xlib: use Bool type for shm field 2010-10-21 19:37:11 -06:00