diff options
author | Kristian Høgsberg <[email protected]> | 2010-07-19 15:15:15 -0400 |
---|---|---|
committer | Kristian Høgsberg <[email protected]> | 2010-07-19 22:45:50 -0400 |
commit | cb2a66fd0c095fe03be5aaf88c8d48f5867425d3 (patch) | |
tree | 95dbcc227ee10feabdbaa031ee7dd3b7eace228d /src/mesa/drivers/dri | |
parent | f972115d33e391499e049b83a1559959f2ca9f72 (diff) |
glx: Drop support for GLX_MESA_allocate_memory
Only r200 implemented it.
Diffstat (limited to 'src/mesa/drivers/dri')
-rw-r--r-- | src/mesa/drivers/dri/r200/r200_ioctl.c | 107 | ||||
-rw-r--r-- | src/mesa/drivers/dri/r200/r200_ioctl.h | 5 | ||||
-rw-r--r-- | src/mesa/drivers/dri/radeon/radeon_screen.c | 12 |
3 files changed, 0 insertions, 124 deletions
diff --git a/src/mesa/drivers/dri/r200/r200_ioctl.c b/src/mesa/drivers/dri/r200/r200_ioctl.c index b72f69b7f45..df73de5394a 100644 --- a/src/mesa/drivers/dri/r200/r200_ioctl.c +++ b/src/mesa/drivers/dri/r200/r200_ioctl.c @@ -253,113 +253,6 @@ static void r200Clear( GLcontext *ctx, GLbitfield mask ) } } -/* This version of AllocateMemoryMESA allocates only GART memory, and - * only does so after the point at which the driver has been - * initialized. - * - * Theoretically a valid context isn't required. However, in this - * implementation, it is, as I'm using the hardware lock to protect - * the kernel data structures, and the current context to get the - * device fd. - */ -void *r200AllocateMemoryMESA(__DRIscreen *screen, GLsizei size, - GLfloat readfreq, GLfloat writefreq, - GLfloat priority) -{ - GET_CURRENT_CONTEXT(ctx); - r200ContextPtr rmesa; - int region_offset; - drm_radeon_mem_alloc_t alloc; - int ret; - - if (R200_DEBUG & RADEON_IOCTL) - fprintf(stderr, "%s sz %d %f/%f/%f\n", __FUNCTION__, size, readfreq, - writefreq, priority); - - if (!ctx || !(rmesa = R200_CONTEXT(ctx)) || !rmesa->radeon.radeonScreen->gartTextures.map) - return NULL; - - if (getenv("R200_NO_ALLOC")) - return NULL; - - alloc.region = RADEON_MEM_REGION_GART; - alloc.alignment = 0; - alloc.size = size; - alloc.region_offset = ®ion_offset; - - ret = drmCommandWriteRead( rmesa->radeon.radeonScreen->driScreen->fd, - DRM_RADEON_ALLOC, - &alloc, sizeof(alloc)); - - if (ret) { - fprintf(stderr, "%s: DRM_RADEON_ALLOC ret %d\n", __FUNCTION__, ret); - return NULL; - } - - { - char *region_start = (char *)rmesa->radeon.radeonScreen->gartTextures.map; - return (void *)(region_start + region_offset); - } -} - - -/* Called via glXFreeMemoryMESA() */ -void r200FreeMemoryMESA(__DRIscreen *screen, GLvoid *pointer) -{ - GET_CURRENT_CONTEXT(ctx); - r200ContextPtr rmesa; - ptrdiff_t region_offset; - drm_radeon_mem_free_t memfree; - int ret; - - if (R200_DEBUG & RADEON_IOCTL) - fprintf(stderr, "%s %p\n", __FUNCTION__, pointer); - - if (!ctx || !(rmesa = R200_CONTEXT(ctx)) || !rmesa->radeon.radeonScreen->gartTextures.map) { - fprintf(stderr, "%s: no context\n", __FUNCTION__); - return; - } - - region_offset = (char *)pointer - (char *)rmesa->radeon.radeonScreen->gartTextures.map; - - if (region_offset < 0 || - region_offset > rmesa->radeon.radeonScreen->gartTextures.size) { - fprintf(stderr, "offset %d outside range 0..%d\n", region_offset, - rmesa->radeon.radeonScreen->gartTextures.size); - return; - } - - memfree.region = RADEON_MEM_REGION_GART; - memfree.region_offset = region_offset; - - ret = drmCommandWrite( rmesa->radeon.radeonScreen->driScreen->fd, - DRM_RADEON_FREE, - &memfree, sizeof(memfree)); - - if (ret) - fprintf(stderr, "%s: DRM_RADEON_FREE ret %d\n", __FUNCTION__, ret); -} - -/* Called via glXGetMemoryOffsetMESA() */ -GLuint r200GetMemoryOffsetMESA(__DRIscreen *screen, const GLvoid *pointer) -{ - GET_CURRENT_CONTEXT(ctx); - r200ContextPtr rmesa; - GLuint card_offset; - - if (!ctx || !(rmesa = R200_CONTEXT(ctx)) ) { - fprintf(stderr, "%s: no context\n", __FUNCTION__); - return ~0; - } - - if (!r200IsGartMemory( rmesa, pointer, 0 )) - return ~0; - - card_offset = r200GartOffsetFromVirtual( rmesa, pointer ); - - return card_offset - rmesa->radeon.radeonScreen->gart_base; -} - GLboolean r200IsGartMemory( r200ContextPtr rmesa, const GLvoid *pointer, GLint size ) { diff --git a/src/mesa/drivers/dri/r200/r200_ioctl.h b/src/mesa/drivers/dri/r200/r200_ioctl.h index 8d51aefa042..c5dca89bc76 100644 --- a/src/mesa/drivers/dri/r200/r200_ioctl.h +++ b/src/mesa/drivers/dri/r200/r200_ioctl.h @@ -64,11 +64,6 @@ extern void r200EmitAOS(r200ContextPtr rmesa, GLuint nr, GLuint offset); extern void r200InitIoctlFuncs( struct dd_function_table *functions ); -extern void *r200AllocateMemoryMESA( __DRIscreen *screen, GLsizei size, GLfloat readfreq, - GLfloat writefreq, GLfloat priority ); -extern void r200FreeMemoryMESA( __DRIscreen *screen, GLvoid *pointer ); -extern GLuint r200GetMemoryOffsetMESA( __DRIscreen *screen, const GLvoid *pointer ); - extern GLboolean r200IsGartMemory( r200ContextPtr rmesa, const GLvoid *pointer, GLint size ); diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.c b/src/mesa/drivers/dri/radeon/radeon_screen.c index 956ffeb2683..efe6b2e3bb3 100644 --- a/src/mesa/drivers/dri/radeon/radeon_screen.c +++ b/src/mesa/drivers/dri/radeon/radeon_screen.c @@ -338,12 +338,6 @@ static const __DRItexBufferExtension radeonTexBufferExtension = { #endif #if defined(RADEON_R200) -static const __DRIallocateExtension r200AllocateExtension = { - { __DRI_ALLOCATE, __DRI_ALLOCATE_VERSION }, - r200AllocateMemoryMESA, - r200FreeMemoryMESA, - r200GetMemoryOffsetMESA -}; static const __DRItexOffsetExtension r200texOffsetExtension = { { __DRI_TEX_OFFSET, __DRI_TEX_OFFSET_VERSION }, @@ -1222,9 +1216,6 @@ radeonCreateScreen( __DRIscreen *sPriv ) #endif #if defined(RADEON_R200) - if (IS_R200_CLASS(screen)) - screen->extensions[i++] = &r200AllocateExtension.base; - screen->extensions[i++] = &r200texOffsetExtension.base; #endif @@ -1380,9 +1371,6 @@ radeonCreateScreen2(__DRIscreen *sPriv) #endif #if defined(RADEON_R200) - if (IS_R200_CLASS(screen)) - screen->extensions[i++] = &r200AllocateExtension.base; - screen->extensions[i++] = &r200TexBufferExtension.base; #endif |