summaryrefslogtreecommitdiff
path: root/src/gallium/winsys/drm
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/winsys/drm')
-rw-r--r--src/gallium/winsys/drm/intel/SConscript7
-rw-r--r--src/gallium/winsys/drm/intel/dri/Makefile5
-rw-r--r--src/gallium/winsys/drm/intel/dri/SConscript16
-rw-r--r--src/gallium/winsys/drm/intel/gem/SConscript17
-rw-r--r--src/gallium/winsys/drm/intel/gem/intel_be_api.c6
-rw-r--r--src/gallium/winsys/drm/radeon/core/radeon_drm.c8
-rw-r--r--src/gallium/winsys/drm/radeon/core/radeon_r300.c44
-rw-r--r--src/gallium/winsys/drm/radeon/core/radeon_r300.h13
-rw-r--r--src/gallium/winsys/drm/radeon/dri/Makefile1
-rw-r--r--src/gallium/winsys/drm/radeon/egl/Makefile1
10 files changed, 92 insertions, 26 deletions
diff --git a/src/gallium/winsys/drm/intel/SConscript b/src/gallium/winsys/drm/intel/SConscript
new file mode 100644
index 0000000000..50d7b75ed6
--- /dev/null
+++ b/src/gallium/winsys/drm/intel/SConscript
@@ -0,0 +1,7 @@
+Import('*')
+
+SConscript(['gem/SConscript',])
+
+if 'mesa' in env['statetrackers']:
+
+ SConscript(['dri/SConscript'])
diff --git a/src/gallium/winsys/drm/intel/dri/Makefile b/src/gallium/winsys/drm/intel/dri/Makefile
index a4704bc050..de39e759d8 100644
--- a/src/gallium/winsys/drm/intel/dri/Makefile
+++ b/src/gallium/winsys/drm/intel/dri/Makefile
@@ -6,6 +6,7 @@ LIBNAME = i915_dri.so
PIPE_DRIVERS = \
$(TOP)/src/gallium/state_trackers/dri/libdridrm.a \
$(TOP)/src/gallium/winsys/drm/intel/gem/libinteldrm.a \
+ $(TOP)/src/gallium/drivers/trace/libtrace.a \
$(TOP)/src/gallium/drivers/softpipe/libsoftpipe.a \
$(TOP)/src/gallium/drivers/i915simple/libi915simple.a
@@ -21,5 +22,5 @@ include ../../Makefile.template
DRI_LIB_DEPS += -ldrm_intel
symlinks: $(TOP)/$(LIB_DIR)/gallium
- @rm -f $(TOP)/lib/gallium/i965_dri.so
- ln -s i915_dri.so $(TOP)/lib/gallium/i965_dri.so
+ @rm -f $(TOP)/$(LIB_DIR)/gallium/i965_dri.so
+ ln -s i915_dri.so $(TOP)/$(LIB_DIR)/gallium/i965_dri.so
diff --git a/src/gallium/winsys/drm/intel/dri/SConscript b/src/gallium/winsys/drm/intel/dri/SConscript
new file mode 100644
index 0000000000..e14e96e32f
--- /dev/null
+++ b/src/gallium/winsys/drm/intel/dri/SConscript
@@ -0,0 +1,16 @@
+Import('*')
+
+env = drienv.Clone()
+
+drivers = [
+ softpipe,
+ i915simple,
+ trace,
+ inteldrm
+]
+
+env.SharedLibrary(
+ target ='i915_dri.so',
+ source = COMMON_GALLIUM_SOURCES,
+ LIBS = drivers + mesa + auxiliaries + env['LIBS'],
+)
diff --git a/src/gallium/winsys/drm/intel/gem/SConscript b/src/gallium/winsys/drm/intel/gem/SConscript
new file mode 100644
index 0000000000..ea8a2e55f6
--- /dev/null
+++ b/src/gallium/winsys/drm/intel/gem/SConscript
@@ -0,0 +1,17 @@
+Import('*')
+
+env = drienv.Clone()
+
+inteldrm_sources = [
+ 'intel_be_api.c',
+ 'intel_be_batchbuffer.c',
+ 'intel_be_context.c',
+ 'intel_be_device.c',
+]
+
+inteldrm = env.ConvenienceLibrary(
+ target ='inteldrm',
+ source = inteldrm_sources,
+)
+
+Export('inteldrm')
diff --git a/src/gallium/winsys/drm/intel/gem/intel_be_api.c b/src/gallium/winsys/drm/intel/gem/intel_be_api.c
index f4ef7c2d88..a74be13bf7 100644
--- a/src/gallium/winsys/drm/intel/gem/intel_be_api.c
+++ b/src/gallium/winsys/drm/intel/gem/intel_be_api.c
@@ -2,7 +2,13 @@
#include "intel_be_api.h"
#include "i915simple/i915_winsys.h"
+#ifdef DEBUG
+#include "trace/trace_drm.h"
+
+struct drm_api hooks =
+#else
struct drm_api drm_api_hooks =
+#endif
{
/* intel_be_context.c */
.create_context = intel_be_create_context,
diff --git a/src/gallium/winsys/drm/radeon/core/radeon_drm.c b/src/gallium/winsys/drm/radeon/core/radeon_drm.c
index 428d3f65a1..5406d2bbea 100644
--- a/src/gallium/winsys/drm/radeon/core/radeon_drm.c
+++ b/src/gallium/winsys/drm/radeon/core/radeon_drm.c
@@ -30,6 +30,10 @@
#include "radeon_drm.h"
+#ifdef DEBUG
+#include "trace/trace_drm.h"
+#endif
+
/* Create a pipe_screen. */
struct pipe_screen* radeon_create_screen(int drmFB,
struct drm_create_screen_arg *arg)
@@ -112,7 +116,11 @@ boolean radeon_global_handle_from_buffer(struct pipe_screen* screen,
return TRUE;
}
+#ifdef DEBUG
+struct drm_api hooks = {
+#else
struct drm_api drm_api_hooks = {
+#endif
.create_screen = radeon_create_screen,
.create_context = radeon_create_context,
/* XXX fix this */
diff --git a/src/gallium/winsys/drm/radeon/core/radeon_r300.c b/src/gallium/winsys/drm/radeon/core/radeon_r300.c
index be70ead68d..65366e242c 100644
--- a/src/gallium/winsys/drm/radeon/core/radeon_r300.c
+++ b/src/gallium/winsys/drm/radeon/core/radeon_r300.c
@@ -57,10 +57,6 @@ static boolean radeon_r300_validate(struct r300_winsys* winsys)
(struct radeon_winsys_priv*)winsys->radeon_winsys;
struct radeon_cs_space_check* sc = priv->sc;
- debug_printf("Validation count: %d\n", priv->bo_count);
- for (i = 0; i < priv->bo_count; i++) {
- debug_printf("BO %d: %p rd: %d wd: %d\n", i, sc[i].bo, sc[i].read_domains, sc[i].write_domain);
- }
retval = radeon_cs_space_check(priv->cs, sc, priv->bo_count);
if (retval == RADEON_CS_SPACE_OP_TO_BIG) {
@@ -152,44 +148,44 @@ static void radeon_r300_flush_cs(struct r300_winsys* winsys)
/* Helper function to do the ioctls needed for setup and init. */
static void do_ioctls(struct r300_winsys* winsys, int fd)
{
- struct drm_radeon_gem_info info = {0};
+ struct drm_radeon_gem_info gem_info = {0};
drm_radeon_getparam_t gp = {0};
+ struct drm_radeon_info info = {0};
int target = 0;
int retval;
+ info.value = &target;
gp.value = &target;
- /* First, get the number of pixel pipes */
- gp.param = RADEON_PARAM_NUM_GB_PIPES;
- retval = drmCommandWriteRead(fd, DRM_RADEON_GETPARAM, &gp, sizeof(gp));
+ /* First, get PCI ID */
+ info.request = RADEON_INFO_DEVICE_ID;
+ retval = drmCommandWriteRead(fd, DRM_RADEON_INFO, &info, sizeof(info));
if (retval) {
- fprintf(stderr, "%s: Failed to get GB pipe count, error number %d\n",
+ fprintf(stderr, "%s: New ioctl for PCI ID failed "
+ "(error number %d), trying classic ioctl...\n",
__FUNCTION__, retval);
- exit(1);
- }
- winsys->gb_pipes = target;
-
- /* Then, get PCI ID */
- gp.param = RADEON_PARAM_DEVICE_ID;
- retval = drmCommandWriteRead(fd, DRM_RADEON_GETPARAM, &gp, sizeof(gp));
- if (retval) {
- fprintf(stderr, "%s: Failed to get PCI ID, error number %d\n",
- __FUNCTION__, retval);
- exit(1);
+ gp.param = RADEON_PARAM_DEVICE_ID;
+ retval = drmCommandWriteRead(fd, DRM_RADEON_GETPARAM, &gp,
+ sizeof(gp));
+ if (retval) {
+ fprintf(stderr, "%s: Failed to get PCI ID, "
+ "error number %d\n", __FUNCTION__, retval);
+ exit(1);
+ }
}
winsys->pci_id = target;
- /* Finally, retrieve MM info */
+ /* Then, retrieve MM info */
retval = drmCommandWriteRead(fd, DRM_RADEON_GEM_INFO,
- &info, sizeof(info));
+ &gem_info, sizeof(gem_info));
if (retval) {
fprintf(stderr, "%s: Failed to get MM info, error number %d\n",
__FUNCTION__, retval);
exit(1);
}
- winsys->gart_size = info.gart_size;
+ winsys->gart_size = gem_info.gart_size;
/* XXX */
- winsys->vram_size = info.vram_visible;
+ winsys->vram_size = gem_info.vram_visible;
}
struct r300_winsys*
diff --git a/src/gallium/winsys/drm/radeon/core/radeon_r300.h b/src/gallium/winsys/drm/radeon/core/radeon_r300.h
index 5c373cd084..a2e0e58248 100644
--- a/src/gallium/winsys/drm/radeon/core/radeon_r300.h
+++ b/src/gallium/winsys/drm/radeon/core/radeon_r300.h
@@ -31,5 +31,18 @@
#include "radeon_buffer.h"
+/* protect us from bonghits */
+#ifndef RADEON_INFO_DEVICE_ID
+#define RADEON_INFO_DEVICE_ID 0
+#endif
+#ifndef DRM_RADEON_INFO
+#define DRM_RADEON_INFO 0x1
+struct drm_radeon_info {
+ uint32_t request;
+ uint32_t pad;
+ uint64_t value;
+};
+#endif
+
struct r300_winsys*
radeon_create_r300_winsys(int fd, struct radeon_winsys* old_winsys);
diff --git a/src/gallium/winsys/drm/radeon/dri/Makefile b/src/gallium/winsys/drm/radeon/dri/Makefile
index c218ee9d01..a9889444de 100644
--- a/src/gallium/winsys/drm/radeon/dri/Makefile
+++ b/src/gallium/winsys/drm/radeon/dri/Makefile
@@ -10,6 +10,7 @@ PIPE_DRIVERS = \
$(TOP)/src/gallium/state_trackers/dri/libdridrm.a \
$(TOP)/src/gallium/winsys/drm/radeon/core/libradeonwinsys.a \
$(TOP)/src/gallium/drivers/softpipe/libsoftpipe.a \
+ $(TOP)/src/gallium/drivers/trace/libtrace.a \
$(TOP)/src/gallium/drivers/r300/libr300.a
C_SOURCES = \
diff --git a/src/gallium/winsys/drm/radeon/egl/Makefile b/src/gallium/winsys/drm/radeon/egl/Makefile
index d989b3aa93..6a1448d1b9 100644
--- a/src/gallium/winsys/drm/radeon/egl/Makefile
+++ b/src/gallium/winsys/drm/radeon/egl/Makefile
@@ -8,6 +8,7 @@ PIPE_DRIVERS = \
$(TOP)/src/gallium/state_trackers/egl/libegldrm.a \
$(GALLIUMDIR)/winsys/drm/radeon/core/libradeonwinsys.a \
$(TOP)/src/gallium/drivers/softpipe/libsoftpipe.a \
+ $(TOP)/src/gallium/drivers/trace/libtrace.a \
$(TOP)/src/gallium/drivers/r300/libr300.a
DRIVER_SOURCES =