diff options
Diffstat (limited to 'src/gallium/winsys/i965/drm')
-rw-r--r-- | src/gallium/winsys/i965/drm/Makefile | 2 | ||||
-rw-r--r-- | src/gallium/winsys/i965/drm/SConscript | 2 | ||||
-rw-r--r-- | src/gallium/winsys/i965/drm/i965_drm_buffer.c | 8 | ||||
-rw-r--r-- | src/gallium/winsys/i965/drm/i965_drm_public.h | 9 | ||||
-rw-r--r-- | src/gallium/winsys/i965/drm/i965_drm_winsys.c (renamed from src/gallium/winsys/i965/drm/i965_drm_api.c) | 52 | ||||
-rw-r--r-- | src/gallium/winsys/i965/drm/i965_drm_winsys.h | 4 |
6 files changed, 21 insertions, 56 deletions
diff --git a/src/gallium/winsys/i965/drm/Makefile b/src/gallium/winsys/i965/drm/Makefile index bbb71e25d84..46f98d7a24a 100644 --- a/src/gallium/winsys/i965/drm/Makefile +++ b/src/gallium/winsys/i965/drm/Makefile @@ -5,7 +5,7 @@ LIBNAME = i965drm C_SOURCES = \ i965_drm_buffer.c \ - i965_drm_api.c + i965_drm_winsys.c LIBRARY_INCLUDES = $(shell pkg-config libdrm --cflags-only-I) diff --git a/src/gallium/winsys/i965/drm/SConscript b/src/gallium/winsys/i965/drm/SConscript index abf9aac5c01..785be449f70 100644 --- a/src/gallium/winsys/i965/drm/SConscript +++ b/src/gallium/winsys/i965/drm/SConscript @@ -5,8 +5,8 @@ env = env.Clone() env.ParseConfig('pkg-config --cflags libdrm') i965drm_sources = [ - 'i965_drm_api.c', 'i965_drm_buffer.c', + 'i965_drm_winsys.c', ] i965drm = env.ConvenienceLibrary( diff --git a/src/gallium/winsys/i965/drm/i965_drm_buffer.c b/src/gallium/winsys/i965/drm/i965_drm_buffer.c index 33a17496b2b..ed62db60bbb 100644 --- a/src/gallium/winsys/i965/drm/i965_drm_buffer.c +++ b/src/gallium/winsys/i965/drm/i965_drm_buffer.c @@ -1,5 +1,5 @@ -#include "state_tracker/drm_api.h" +#include "state_tracker/drm_driver.h" #include "i965_drm_winsys.h" #include "util/u_memory.h" #include "util/u_inlines.h" @@ -322,7 +322,7 @@ i965_libdrm_bo_subdata(struct brw_winsys_buffer *buffer, nr_reloc); if (BRW_DUMP) - brw_dump_data( idws->id, + brw_dump_data( idws->base.pci_id, data_type, buf->bo->offset + offset, data, size ); @@ -460,10 +460,10 @@ i965_libdrm_bo_flush_range(struct brw_winsys_buffer *buffer, offset, length); if (BRW_DUMP) - brw_dump_data( idws->id, + brw_dump_data( idws->base.pci_id, buf->data_type, buf->bo->offset + offset, - buf->bo->virtual + offset, + (char*)buf->bo->virtual + offset, length ); } diff --git a/src/gallium/winsys/i965/drm/i965_drm_public.h b/src/gallium/winsys/i965/drm/i965_drm_public.h new file mode 100644 index 00000000000..2913b079747 --- /dev/null +++ b/src/gallium/winsys/i965/drm/i965_drm_public.h @@ -0,0 +1,9 @@ + +#ifndef I965_DRM_PUBLIC_H +#define I965_DRM_PUBLIC_H + +struct brw_winsys_screen; + +struct brw_winsys_screen * i965_drm_winsys_screen_create(int drmFD); + +#endif diff --git a/src/gallium/winsys/i965/drm/i965_drm_api.c b/src/gallium/winsys/i965/drm/i965_drm_winsys.c index bd4dcfc9be7..b08e622db94 100644 --- a/src/gallium/winsys/i965/drm/i965_drm_api.c +++ b/src/gallium/winsys/i965/drm/i965_drm_winsys.c @@ -1,17 +1,11 @@ #include <stdio.h> -#include "state_tracker/drm_api.h" +#include "state_tracker/drm_driver.h" #include "i965_drm_winsys.h" +#include "i965_drm_public.h" #include "util/u_memory.h" -#include "i965/brw_context.h" /* XXX: shouldn't be doing this */ -#include "i965/brw_screen.h" /* XXX: shouldn't be doing this */ - -#include "trace/tr_drm.h" - -#include "../../sw/drm/sw_drm_api.h" - /* * Helper functions */ @@ -52,34 +46,22 @@ i965_libdrm_winsys_destroy(struct brw_winsys_screen *iws) FREE(idws); } -static struct pipe_screen * -i965_libdrm_create_screen(struct drm_api *api, int drmFD, - struct drm_create_screen_arg *arg) +struct brw_winsys_screen * +i965_drm_winsys_screen_create(int drmFD) { struct i965_libdrm_winsys *idws; - unsigned int deviceID; debug_printf("%s\n", __FUNCTION__); - if (arg != NULL) { - switch(arg->mode) { - case DRM_CREATE_NORMAL: - break; - default: - return NULL; - } - } - idws = CALLOC_STRUCT(i965_libdrm_winsys); if (!idws) return NULL; - i965_libdrm_get_device_id(&deviceID); + i965_libdrm_get_device_id(&idws->base.pci_id); i965_libdrm_winsys_init_buffer_functions(idws); idws->fd = drmFD; - idws->id = deviceID; idws->base.destroy = i965_libdrm_winsys_destroy; @@ -88,27 +70,5 @@ i965_libdrm_create_screen(struct drm_api *api, int drmFD, idws->send_cmd = !debug_get_bool_option("BRW_NO_HW", FALSE); - return brw_create_screen(&idws->base, deviceID); -} - -struct drm_api i965_libdrm_api = -{ - .name = "i965", - .driver_name = "i915", - .create_screen = i965_libdrm_create_screen, - .destroy = NULL, -}; - -struct drm_api * -drm_api_create() -{ - struct drm_api *api = NULL; - - if (api == NULL && debug_get_bool_option("BRW_SOFTPIPE", FALSE)) - api = sw_drm_api_create(&i965_libdrm_api); - - if (api == NULL) - api = &i965_libdrm_api; - - return trace_drm_create(api); + return &idws->base; } diff --git a/src/gallium/winsys/i965/drm/i965_drm_winsys.h b/src/gallium/winsys/i965/drm/i965_drm_winsys.h index c6a7d4a8c51..82dbe61cc51 100644 --- a/src/gallium/winsys/i965/drm/i965_drm_winsys.h +++ b/src/gallium/winsys/i965/drm/i965_drm_winsys.h @@ -22,8 +22,6 @@ struct i965_libdrm_winsys boolean send_cmd; int fd; /**< Drm file discriptor */ - - unsigned id; }; static INLINE struct i965_libdrm_winsys * @@ -32,8 +30,6 @@ i965_libdrm_winsys(struct brw_winsys_screen *iws) return (struct i965_libdrm_winsys *)iws; } -struct i965_libdrm_winsys *i965_libdrm_winsys_create(int fd, unsigned pci_id); - void i965_libdrm_winsys_init_buffer_functions(struct i965_libdrm_winsys *idws); |