From 80026428e3aa8f71ccd42d8d3b5e0a15c150dda2 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Fri, 6 Feb 2009 13:28:15 -0800 Subject: [PATCH] Rename winsys amd to radeon. --- .../winsys/drm/{amd => radeon}/Makefile | 12 +- .../winsys/drm/{amd => radeon}/SConscript | 10 +- .../amd_buffer.c => radeon/radeon_buffer.c} | 140 +++++++++--------- .../amd_buffer.h => radeon/radeon_buffer.h} | 18 +-- .../amd_context.c => radeon/radeon_context.c} | 110 +++++++------- .../amd_context.h => radeon/radeon_context.h} | 24 +-- .../{amd/amd_r300.c => radeon/radeon_r300.c} | 18 +-- .../{amd/amd_r300.h => radeon/radeon_r300.h} | 4 +- .../amd_screen.c => radeon/radeon_screen.c} | 120 +++++++-------- .../amd_screen.h => radeon/radeon_screen.h} | 6 +- .../radeon_winsys_softpipe.c} | 30 ++-- .../radeon_winsys_softpipe.h} | 8 +- 12 files changed, 250 insertions(+), 250 deletions(-) rename src/gallium/winsys/drm/{amd => radeon}/Makefile (76%) rename src/gallium/winsys/drm/{amd => radeon}/SConscript (75%) rename src/gallium/winsys/drm/{amd/amd_buffer.c => radeon/radeon_buffer.c} (53%) rename src/gallium/winsys/drm/{amd/amd_buffer.h => radeon/radeon_buffer.h} (81%) rename src/gallium/winsys/drm/{amd/amd_context.c => radeon/radeon_context.c} (74%) rename src/gallium/winsys/drm/{amd/amd_context.h => radeon/radeon_context.h} (82%) rename src/gallium/winsys/drm/{amd/amd_r300.c => radeon/radeon_r300.c} (85%) rename src/gallium/winsys/drm/{amd/amd_r300.h => radeon/radeon_r300.h} (94%) rename src/gallium/winsys/drm/{amd/amd_screen.c => radeon/radeon_screen.c} (68%) rename src/gallium/winsys/drm/{amd/amd_screen.h => radeon/radeon_screen.h} (95%) rename src/gallium/winsys/drm/{amd/amd_winsys_softpipe.c => radeon/radeon_winsys_softpipe.c} (71%) rename src/gallium/winsys/drm/{amd/amd_winsys_softpipe.h => radeon/radeon_winsys_softpipe.h} (87%) diff --git a/src/gallium/winsys/drm/amd/Makefile b/src/gallium/winsys/drm/radeon/Makefile similarity index 76% rename from src/gallium/winsys/drm/amd/Makefile rename to src/gallium/winsys/drm/radeon/Makefile index fb778734044..dca1e3233a0 100644 --- a/src/gallium/winsys/drm/amd/Makefile +++ b/src/gallium/winsys/drm/radeon/Makefile @@ -2,7 +2,7 @@ TOP = ../../../../.. include $(TOP)/configs/current -LIBNAME = amd_dri.so +LIBNAME = radeon_dri.so MINIGLX_SOURCES = @@ -11,11 +11,11 @@ PIPE_DRIVERS = \ $(TOP)/src/gallium/drivers/r300/libr300.a DRIVER_SOURCES = \ - amd_buffer.c \ - amd_context.c \ - amd_r300.c \ - amd_screen.c \ - amd_winsys_softpipe.c + radeon_buffer.c \ + radeon_context.c \ + radeon_r300.c \ + radeon_screen.c \ + radeon_winsys_softpipe.c C_SOURCES = \ $(COMMON_GALLIUM_SOURCES) \ diff --git a/src/gallium/winsys/drm/amd/SConscript b/src/gallium/winsys/drm/radeon/SConscript similarity index 75% rename from src/gallium/winsys/drm/amd/SConscript rename to src/gallium/winsys/drm/radeon/SConscript index a4856da23cc..2435211a327 100644 --- a/src/gallium/winsys/drm/amd/SConscript +++ b/src/gallium/winsys/drm/radeon/SConscript @@ -5,10 +5,10 @@ if 'mesa' in env['statetrackers']: env = drienv.Clone() DRIVER_SOURCES = [ - 'amd_buffer.c', - 'amd_context.c', - 'amd_screen.c', - 'amd_winsys_softpipe.c', + 'radeon_buffer.c', + 'radeon_context.c', + 'radeon_screen.c', + 'radeon_winsys_softpipe.c', ] sources = \ @@ -22,7 +22,7 @@ if 'mesa' in env['statetrackers']: # TODO: write a wrapper function http://www.scons.org/wiki/WrapperFunctions env.SharedLibrary( - target ='amd_dri.so', + target ='radeon_dri.so', source = sources, LIBS = drivers + mesa + auxiliaries + env['LIBS'], ) diff --git a/src/gallium/winsys/drm/amd/amd_buffer.c b/src/gallium/winsys/drm/radeon/radeon_buffer.c similarity index 53% rename from src/gallium/winsys/drm/amd/amd_buffer.c rename to src/gallium/winsys/drm/radeon/radeon_buffer.c index 4b831c7fcc2..259a505c0a6 100644 --- a/src/gallium/winsys/drm/amd/amd_buffer.c +++ b/src/gallium/winsys/drm/radeon/radeon_buffer.c @@ -32,34 +32,34 @@ #include "state_tracker/st_public.h" #include "pipe/p_defines.h" #include "pipe/p_inlines.h" -#include "amd_buffer.h" -#include "amd_screen.h" -#include "amd_context.h" +#include "radeon_buffer.h" +#include "radeon_screen.h" +#include "radeon_context.h" #include "radeon_bo.h" #include "radeon_drm.h" -static const char *amd_get_name(struct pipe_winsys *ws) +static const char *radeon_get_name(struct pipe_winsys *ws) { - return "AMD/DRI2"; + return "RADEON/DRI2"; } -static struct pipe_buffer *amd_buffer_create(struct pipe_winsys *ws, +static struct pipe_buffer *radeon_buffer_create(struct pipe_winsys *ws, unsigned alignment, unsigned usage, unsigned size) { - struct amd_pipe_winsys *amd_ws = (struct amd_pipe_winsys *)ws; - struct amd_pipe_buffer *amd_buffer; + struct radeon_pipe_winsys *radeon_ws = (struct radeon_pipe_winsys *)ws; + struct radeon_pipe_buffer *radeon_buffer; uint32_t domain; - amd_buffer = calloc(1, sizeof(*amd_buffer)); - if (amd_buffer == NULL) { + radeon_buffer = calloc(1, sizeof(*radeon_buffer)); + if (radeon_buffer == NULL) { return NULL; } - amd_buffer->base.refcount = 1; - amd_buffer->base.alignment = alignment; - amd_buffer->base.usage = usage; - amd_buffer->base.size = size; + radeon_buffer->base.refcount = 1; + radeon_buffer->base.alignment = alignment; + radeon_buffer->base.usage = usage; + radeon_buffer->base.size = size; domain = 0; @@ -73,148 +73,148 @@ static struct pipe_buffer *amd_buffer_create(struct pipe_winsys *ws, if (usage & PIPE_BUFFER_USAGE_INDEX) { domain |= RADEON_GEM_DOMAIN_GTT; } - amd_buffer->bo = radeon_bo_open(amd_ws->amd_screen->bom, 0, + radeon_buffer->bo = radeon_bo_open(radeon_ws->radeon_screen->bom, 0, size, alignment, domain, 0); - if (amd_buffer->bo == NULL) { - free(amd_buffer); + if (radeon_buffer->bo == NULL) { + free(radeon_buffer); } - return &amd_buffer->base; + return &radeon_buffer->base; } -static struct pipe_buffer *amd_buffer_user_create(struct pipe_winsys *ws, +static struct pipe_buffer *radeon_buffer_user_create(struct pipe_winsys *ws, void *ptr, unsigned bytes) { - struct amd_pipe_buffer *amd_buffer; + struct radeon_pipe_buffer *radeon_buffer; - amd_buffer = (struct amd_pipe_buffer*)amd_buffer_create(ws, 0, 0, bytes); - if (amd_buffer == NULL) { + radeon_buffer = (struct radeon_pipe_buffer*)radeon_buffer_create(ws, 0, 0, bytes); + if (radeon_buffer == NULL) { return NULL; } - radeon_bo_map(amd_buffer->bo, 1); - memcpy(amd_buffer->bo->ptr, ptr, bytes); - radeon_bo_unmap(amd_buffer->bo); - return &amd_buffer->base; + radeon_bo_map(radeon_buffer->bo, 1); + memcpy(radeon_buffer->bo->ptr, ptr, bytes); + radeon_bo_unmap(radeon_buffer->bo); + return &radeon_buffer->base; } -static void amd_buffer_del(struct pipe_winsys *ws, struct pipe_buffer *buffer) +static void radeon_buffer_del(struct pipe_winsys *ws, struct pipe_buffer *buffer) { - struct amd_pipe_buffer *amd_buffer = (struct amd_pipe_buffer*)buffer; + struct radeon_pipe_buffer *radeon_buffer = (struct radeon_pipe_buffer*)buffer; - radeon_bo_unref(amd_buffer->bo); - free(amd_buffer); + radeon_bo_unref(radeon_buffer->bo); + free(radeon_buffer); } -static void *amd_buffer_map(struct pipe_winsys *ws, +static void *radeon_buffer_map(struct pipe_winsys *ws, struct pipe_buffer *buffer, unsigned flags) { - struct amd_pipe_buffer *amd_buffer = (struct amd_pipe_buffer*)buffer; + struct radeon_pipe_buffer *radeon_buffer = (struct radeon_pipe_buffer*)buffer; int write = 0; if (flags & PIPE_BUFFER_USAGE_CPU_WRITE) { write = 1; } - if (radeon_bo_map(amd_buffer->bo, write)) + if (radeon_bo_map(radeon_buffer->bo, write)) return NULL; - return amd_buffer->bo->ptr; + return radeon_buffer->bo->ptr; } -static void amd_buffer_unmap(struct pipe_winsys *ws, struct pipe_buffer *buffer) +static void radeon_buffer_unmap(struct pipe_winsys *ws, struct pipe_buffer *buffer) { - struct amd_pipe_buffer *amd_buffer = (struct amd_pipe_buffer*)buffer; + struct radeon_pipe_buffer *radeon_buffer = (struct radeon_pipe_buffer*)buffer; - radeon_bo_unmap(amd_buffer->bo); + radeon_bo_unmap(radeon_buffer->bo); } -static void amd_fence_reference(struct pipe_winsys *ws, +static void radeon_fence_reference(struct pipe_winsys *ws, struct pipe_fence_handle **ptr, struct pipe_fence_handle *pfence) { } -static int amd_fence_signalled(struct pipe_winsys *ws, +static int radeon_fence_signalled(struct pipe_winsys *ws, struct pipe_fence_handle *pfence, unsigned flag) { return 1; } -static int amd_fence_finish(struct pipe_winsys *ws, +static int radeon_fence_finish(struct pipe_winsys *ws, struct pipe_fence_handle *pfence, unsigned flag) { return 0; } -static void amd_flush_frontbuffer(struct pipe_winsys *pipe_winsys, +static void radeon_flush_frontbuffer(struct pipe_winsys *pipe_winsys, struct pipe_surface *pipe_surface, void *context_private) { /* TODO: call dri2CopyRegion */ } -struct pipe_winsys *amd_pipe_winsys(struct amd_screen *amd_screen) +struct pipe_winsys *radeon_pipe_winsys(struct radeon_screen *radeon_screen) { - struct amd_pipe_winsys *amd_ws; + struct radeon_pipe_winsys *radeon_ws; - amd_ws = calloc(1, sizeof(struct amd_pipe_winsys)); - if (amd_ws == NULL) { + radeon_ws = calloc(1, sizeof(struct radeon_pipe_winsys)); + if (radeon_ws == NULL) { return NULL; } - amd_ws->amd_screen = amd_screen; + radeon_ws->radeon_screen = radeon_screen; - amd_ws->winsys.flush_frontbuffer = amd_flush_frontbuffer; + radeon_ws->winsys.flush_frontbuffer = radeon_flush_frontbuffer; - amd_ws->winsys.buffer_create = amd_buffer_create; - amd_ws->winsys.buffer_destroy = amd_buffer_del; - amd_ws->winsys.user_buffer_create = amd_buffer_user_create; - amd_ws->winsys.buffer_map = amd_buffer_map; - amd_ws->winsys.buffer_unmap = amd_buffer_unmap; + radeon_ws->winsys.buffer_create = radeon_buffer_create; + radeon_ws->winsys.buffer_destroy = radeon_buffer_del; + radeon_ws->winsys.user_buffer_create = radeon_buffer_user_create; + radeon_ws->winsys.buffer_map = radeon_buffer_map; + radeon_ws->winsys.buffer_unmap = radeon_buffer_unmap; - amd_ws->winsys.fence_reference = amd_fence_reference; - amd_ws->winsys.fence_signalled = amd_fence_signalled; - amd_ws->winsys.fence_finish = amd_fence_finish; + radeon_ws->winsys.fence_reference = radeon_fence_reference; + radeon_ws->winsys.fence_signalled = radeon_fence_signalled; + radeon_ws->winsys.fence_finish = radeon_fence_finish; - amd_ws->winsys.get_name = amd_get_name; + radeon_ws->winsys.get_name = radeon_get_name; - return &amd_ws->winsys; + return &radeon_ws->winsys; } -static struct pipe_buffer *amd_buffer_from_handle(struct amd_screen *amd_screen, +static struct pipe_buffer *radeon_buffer_from_handle(struct radeon_screen *radeon_screen, uint32_t handle) { - struct amd_pipe_buffer *amd_buffer; + struct radeon_pipe_buffer *radeon_buffer; struct radeon_bo *bo = NULL; - bo = radeon_bo_open(amd_screen->bom, handle, 0, 0, 0, 0); + bo = radeon_bo_open(radeon_screen->bom, handle, 0, 0, 0, 0); if (bo == NULL) { return NULL; } - amd_buffer = calloc(1, sizeof(struct amd_pipe_buffer)); - if (amd_buffer == NULL) { + radeon_buffer = calloc(1, sizeof(struct radeon_pipe_buffer)); + if (radeon_buffer == NULL) { radeon_bo_unref(bo); return NULL; } - amd_buffer->base.refcount = 1; - amd_buffer->base.usage = PIPE_BUFFER_USAGE_PIXEL; - amd_buffer->bo = bo; - return &amd_buffer->base; + radeon_buffer->base.refcount = 1; + radeon_buffer->base.usage = PIPE_BUFFER_USAGE_PIXEL; + radeon_buffer->bo = bo; + return &radeon_buffer->base; } -struct pipe_surface *amd_surface_from_handle(struct amd_context *amd_context, +struct pipe_surface *radeon_surface_from_handle(struct radeon_context *radeon_context, uint32_t handle, enum pipe_format format, int w, int h, int pitch) { - struct pipe_screen *pipe_screen = amd_context->pipe_screen; - struct pipe_winsys *pipe_winsys = amd_context->pipe_winsys; + struct pipe_screen *pipe_screen = radeon_context->pipe_screen; + struct pipe_winsys *pipe_winsys = radeon_context->pipe_winsys; struct pipe_texture tmpl; struct pipe_surface *ps; struct pipe_texture *pt; struct pipe_buffer *pb; - pb = amd_buffer_from_handle(amd_context->amd_screen, handle); + pb = radeon_buffer_from_handle(radeon_context->radeon_screen, handle); if (pb == NULL) { return NULL; } diff --git a/src/gallium/winsys/drm/amd/amd_buffer.h b/src/gallium/winsys/drm/radeon/radeon_buffer.h similarity index 81% rename from src/gallium/winsys/drm/amd/amd_buffer.h rename to src/gallium/winsys/drm/radeon/radeon_buffer.h index 238ca572aea..c626c20229b 100644 --- a/src/gallium/winsys/drm/amd/amd_buffer.h +++ b/src/gallium/winsys/drm/radeon/radeon_buffer.h @@ -27,26 +27,26 @@ * Authors: * Jérôme Glisse */ -#ifndef AMD_BUFFER_H -#define AMD_BUFFER_H +#ifndef RADEON_BUFFER_H +#define RADEON_BUFFER_H #include "pipe/internal/p_winsys_screen.h" -#include "amd_screen.h" -#include "amd_context.h" +#include "radeon_screen.h" +#include "radeon_context.h" #include "radeon_bo.h" -struct amd_pipe_buffer { +struct radeon_pipe_buffer { struct pipe_buffer base; struct radeon_bo *bo; }; -struct amd_pipe_winsys { +struct radeon_pipe_winsys { struct pipe_winsys winsys; - struct amd_screen *amd_screen; + struct radeon_screen *radeon_screen; }; -struct pipe_winsys *amd_pipe_winsys(struct amd_screen *amd_screen); -struct pipe_surface *amd_surface_from_handle(struct amd_context *amd_context, +struct pipe_winsys *radeon_pipe_winsys(struct radeon_screen *radeon_screen); +struct pipe_surface *radeon_surface_from_handle(struct radeon_context *radeon_context, uint32_t handle, enum pipe_format format, int w, int h, int pitch); diff --git a/src/gallium/winsys/drm/amd/amd_context.c b/src/gallium/winsys/drm/radeon/radeon_context.c similarity index 74% rename from src/gallium/winsys/drm/amd/amd_context.c rename to src/gallium/winsys/drm/radeon/radeon_context.c index e089cf68744..a9d15776341 100644 --- a/src/gallium/winsys/drm/amd/amd_context.c +++ b/src/gallium/winsys/drm/radeon/radeon_context.c @@ -33,10 +33,10 @@ #include "pipe/p_inlines.h" #include "state_tracker/st_public.h" #include "state_tracker/st_context.h" -#include "amd_screen.h" -#include "amd_context.h" -#include "amd_buffer.h" -#include "amd_winsys_softpipe.h" +#include "radeon_screen.h" +#include "radeon_context.h" +#include "radeon_buffer.h" +#include "radeon_winsys_softpipe.h" #define need_GL_ARB_fragment_program #define need_GL_ARB_multisample @@ -61,9 +61,9 @@ #include "extension_helper.h" /** - * Extension strings exported by the amd driver. + * Extension strings exported by the radeon driver. */ -const struct dri_extension amd_card_extensions[] = { +const struct dri_extension radeon_card_extensions[] = { {"GL_ARB_multitexture", NULL}, {"GL_ARB_texture_border_clamp", NULL}, {"GL_ARB_texture_rectangle", NULL}, @@ -92,21 +92,21 @@ const struct dri_extension amd_card_extensions[] = { {NULL, NULL} }; -static void amd_update_renderbuffers(__DRIcontext *dri_context, +static void radeon_update_renderbuffers(__DRIcontext *dri_context, __DRIdrawable *dri_drawable) { - struct amd_framebuffer *amd_fb; - struct amd_context *amd_context; + struct radeon_framebuffer *radeon_fb; + struct radeon_context *radeon_context; unsigned attachments[10]; __DRIbuffer *buffers; __DRIscreen *screen; int i, count; - amd_context = dri_context->driverPrivate; + radeon_context = dri_context->driverPrivate; screen = dri_drawable->driScreenPriv; - amd_fb = dri_drawable->driverPrivate; + radeon_fb = dri_drawable->driverPrivate; for (count = 0, i = 0; count < 6; count++) { - if (amd_fb->attachments & (1 << count)) { + if (radeon_fb->attachments & (1 << count)) { attachments[i++] = count; } } @@ -195,112 +195,112 @@ static void amd_update_renderbuffers(__DRIcontext *dri_context, return; } - ps = amd_surface_from_handle(amd_context, + ps = radeon_surface_from_handle(radeon_context, buffers[i].name, format, dri_drawable->w, dri_drawable->h, buffers[i].pitch); assert(ps); - st_set_framebuffer_surface(amd_fb->st_framebuffer, index, ps); + st_set_framebuffer_surface(radeon_fb->st_framebuffer, index, ps); } - st_resize_framebuffer(amd_fb->st_framebuffer, + st_resize_framebuffer(radeon_fb->st_framebuffer, dri_drawable->w, dri_drawable->h); } -GLboolean amd_context_create(const __GLcontextModes *visual, +GLboolean radeon_context_create(const __GLcontextModes *visual, __DRIcontextPrivate *dri_context, void *shared_context) { __DRIscreenPrivate *dri_screen; - struct amd_context *amd_context; - struct amd_screen *amd_screen; + struct radeon_context *radeon_context; + struct radeon_screen *radeon_screen; struct pipe_context *pipe; struct st_context *shared_st_context = NULL; dri_context->driverPrivate = NULL; - amd_context = calloc(1, sizeof(struct amd_context)); - if (amd_context == NULL) { + radeon_context = calloc(1, sizeof(struct radeon_context)); + if (radeon_context == NULL) { return GL_FALSE; } if (shared_context) { - shared_st_context = ((struct amd_context*)shared_context)->st_context; + shared_st_context = ((struct radeon_context*)shared_context)->st_context; } dri_screen = dri_context->driScreenPriv; - amd_screen = dri_screen->private; - amd_context->dri_screen = dri_screen; - amd_context->amd_screen = amd_screen; - amd_context->drm_fd = dri_screen->fd; + radeon_screen = dri_screen->private; + radeon_context->dri_screen = dri_screen; + radeon_context->radeon_screen = radeon_screen; + radeon_context->drm_fd = dri_screen->fd; - amd_context->pipe_winsys = amd_pipe_winsys(amd_screen); - if (amd_context->pipe_winsys == NULL) { - free(amd_context); + radeon_context->pipe_winsys = radeon_pipe_winsys(radeon_screen); + if (radeon_context->pipe_winsys == NULL) { + free(radeon_context); return GL_FALSE; } - if (!getenv("AMD_SOFTPIPE")) { + if (!getenv("RADEON_SOFTPIPE")) { fprintf(stderr, "Creating r300 context...\n"); pipe = r300_create_context(NULL, - amd_context->pipe_winsys, - amd_create_r300_winsys(amd_context->drm_fd)); - amd_context->pipe_screen = pipe->screen; + radeon_context->pipe_winsys, + radeon_create_r300_winsys(radeon_context->drm_fd)); + radeon_context->pipe_screen = pipe->screen; } else { - pipe = amd_create_softpipe(amd_context); + pipe = radeon_create_softpipe(radeon_context); } - amd_context->st_context = st_create_context(pipe, visual, + radeon_context->st_context = st_create_context(pipe, visual, shared_st_context); - driInitExtensions(amd_context->st_context->ctx, - amd_card_extensions, GL_TRUE); - dri_context->driverPrivate = amd_context; + driInitExtensions(radeon_context->st_context->ctx, + radeon_card_extensions, GL_TRUE); + dri_context->driverPrivate = radeon_context; return GL_TRUE; } -void amd_context_destroy(__DRIcontextPrivate *dri_context) +void radeon_context_destroy(__DRIcontextPrivate *dri_context) { - struct amd_context *amd_context; + struct radeon_context *radeon_context; - amd_context = dri_context->driverPrivate; - st_finish(amd_context->st_context); - st_destroy_context(amd_context->st_context); - free(amd_context); + radeon_context = dri_context->driverPrivate; + st_finish(radeon_context->st_context); + st_destroy_context(radeon_context->st_context); + free(radeon_context); } -GLboolean amd_context_bind(__DRIcontextPrivate *dri_context, +GLboolean radeon_context_bind(__DRIcontextPrivate *dri_context, __DRIdrawablePrivate *dri_drawable, __DRIdrawablePrivate *dri_readable) { - struct amd_framebuffer *drawable; - struct amd_framebuffer *readable; - struct amd_context *amd_context; + struct radeon_framebuffer *drawable; + struct radeon_framebuffer *readable; + struct radeon_context *radeon_context; if (dri_context == NULL) { st_make_current(NULL, NULL, NULL); return GL_TRUE; } - amd_context = dri_context->driverPrivate; + radeon_context = dri_context->driverPrivate; drawable = dri_drawable->driverPrivate; readable = dri_readable->driverPrivate; - st_make_current(amd_context->st_context, + st_make_current(radeon_context->st_context, drawable->st_framebuffer, readable->st_framebuffer); - amd_update_renderbuffers(dri_context, dri_drawable); + radeon_update_renderbuffers(dri_context, dri_drawable); if (dri_drawable != dri_readable) { - amd_update_renderbuffers(dri_context, dri_readable); + radeon_update_renderbuffers(dri_context, dri_readable); } return GL_TRUE; } -GLboolean amd_context_unbind(__DRIcontextPrivate *dri_context) +GLboolean radeon_context_unbind(__DRIcontextPrivate *dri_context) { - struct amd_context *amd_context; + struct radeon_context *radeon_context; - amd_context = dri_context->driverPrivate; - st_flush(amd_context->st_context, PIPE_FLUSH_RENDER_CACHE, NULL); + radeon_context = dri_context->driverPrivate; + st_flush(radeon_context->st_context, PIPE_FLUSH_RENDER_CACHE, NULL); return GL_TRUE; } diff --git a/src/gallium/winsys/drm/amd/amd_context.h b/src/gallium/winsys/drm/radeon/radeon_context.h similarity index 82% rename from src/gallium/winsys/drm/amd/amd_context.h rename to src/gallium/winsys/drm/radeon/radeon_context.h index 12557c40c41..d7222b44691 100644 --- a/src/gallium/winsys/drm/amd/amd_context.h +++ b/src/gallium/winsys/drm/radeon/radeon_context.h @@ -27,22 +27,22 @@ * Authors: * Jérôme Glisse */ -#ifndef AMD_CONTEXT_H -#define AMD_CONTEXT_H +#ifndef RADEON_CONTEXT_H +#define RADEON_CONTEXT_H #include "dri_util.h" #include "state_tracker/st_public.h" #include "state_tracker/st_context.h" -#include "amd_screen.h" +#include "radeon_screen.h" -#include "amd_r300.h" +#include "radeon_r300.h" -struct amd_framebuffer { +struct radeon_framebuffer { struct st_framebuffer *st_framebuffer; unsigned attachments; }; -struct amd_context { +struct radeon_context { /* st */ struct st_context *st_context; /* pipe */ @@ -54,17 +54,17 @@ struct amd_context { __DRIdrawablePrivate *dri_readable; /* DRM */ int drm_fd; - /* AMD */ - struct amd_screen *amd_screen; + /* RADEON */ + struct radeon_screen *radeon_screen; }; -GLboolean amd_context_create(const __GLcontextModes*, +GLboolean radeon_context_create(const __GLcontextModes*, __DRIcontextPrivate*, void*); -void amd_context_destroy(__DRIcontextPrivate*); -GLboolean amd_context_bind(__DRIcontextPrivate*, +void radeon_context_destroy(__DRIcontextPrivate*); +GLboolean radeon_context_bind(__DRIcontextPrivate*, __DRIdrawablePrivate*, __DRIdrawablePrivate*); -GLboolean amd_context_unbind(__DRIcontextPrivate*); +GLboolean radeon_context_unbind(__DRIcontextPrivate*); #endif diff --git a/src/gallium/winsys/drm/amd/amd_r300.c b/src/gallium/winsys/drm/radeon/radeon_r300.c similarity index 85% rename from src/gallium/winsys/drm/amd/amd_r300.c rename to src/gallium/winsys/drm/radeon/radeon_r300.c index 04295e8281b..8fe2375e34d 100644 --- a/src/gallium/winsys/drm/amd/amd_r300.c +++ b/src/gallium/winsys/drm/radeon/radeon_r300.c @@ -20,24 +20,24 @@ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE * USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include "amd_r300.h" +#include "radeon_r300.h" -static boolean amd_r300_check_cs(struct radeon_cs* cs, int size) +static boolean radeon_r300_check_cs(struct radeon_cs* cs, int size) { /* XXX check size here, lazy ass! */ return TRUE; } -static void amd_r300_write_cs_reloc(struct radeon_cs* cs, +static void radeon_r300_write_cs_reloc(struct radeon_cs* cs, struct pipe_buffer* pbuffer, uint32_t rd, uint32_t wd, uint32_t flags) { - radeon_cs_write_reloc(cs, ((struct amd_pipe_buffer*)pbuffer)->bo, rd, wd, flags); + radeon_cs_write_reloc(cs, ((struct radeon_pipe_buffer*)pbuffer)->bo, rd, wd, flags); } -static void amd_r300_flush_cs(struct radeon_cs* cs) +static void radeon_r300_flush_cs(struct radeon_cs* cs) { radeon_cs_emit(cs); radeon_cs_erase(cs); @@ -75,7 +75,7 @@ static void do_ioctls(struct r300_winsys* winsys, int fd) } -struct r300_winsys* amd_create_r300_winsys(int fd) +struct r300_winsys* radeon_create_r300_winsys(int fd) { struct r300_winsys* winsys = calloc(1, sizeof(struct r300_winsys)); @@ -85,12 +85,12 @@ struct r300_winsys* amd_create_r300_winsys(int fd) winsys->cs = radeon_cs_create(csm, 1024 * 64 / 4); - winsys->check_cs = amd_r300_check_cs; + winsys->check_cs = radeon_r300_check_cs; winsys->begin_cs = radeon_cs_begin; winsys->write_cs_dword = radeon_cs_write_dword; - winsys->write_cs_reloc = amd_r300_write_cs_reloc; + winsys->write_cs_reloc = radeon_r300_write_cs_reloc; winsys->end_cs = radeon_cs_end; - winsys->flush_cs = amd_r300_flush_cs; + winsys->flush_cs = radeon_r300_flush_cs; return winsys; } diff --git a/src/gallium/winsys/drm/amd/amd_r300.h b/src/gallium/winsys/drm/radeon/radeon_r300.h similarity index 94% rename from src/gallium/winsys/drm/amd/amd_r300.h rename to src/gallium/winsys/drm/radeon/radeon_r300.h index d80c23594cd..8ed95a3a9b1 100644 --- a/src/gallium/winsys/drm/amd/amd_r300.h +++ b/src/gallium/winsys/drm/radeon/radeon_r300.h @@ -29,6 +29,6 @@ #include "r300_winsys.h" -#include "amd_buffer.h" +#include "radeon_buffer.h" -struct r300_winsys* amd_create_r300_winsys(int fd); +struct r300_winsys* radeon_create_r300_winsys(int fd); diff --git a/src/gallium/winsys/drm/amd/amd_screen.c b/src/gallium/winsys/drm/radeon/radeon_screen.c similarity index 68% rename from src/gallium/winsys/drm/amd/amd_screen.c rename to src/gallium/winsys/drm/radeon/radeon_screen.c index d62b47f36d0..e31caff0bf8 100644 --- a/src/gallium/winsys/drm/amd/amd_screen.c +++ b/src/gallium/winsys/drm/radeon/radeon_screen.c @@ -39,16 +39,16 @@ #include "xf86drm.h" #include "drm.h" #include "dri_util.h" -#include "amd_screen.h" -#include "amd_context.h" -#include "amd_buffer.h" +#include "radeon_screen.h" +#include "radeon_context.h" +#include "radeon_buffer.h" #include "radeon_bo.h" #include "radeon_bo_gem.h" #include "radeon_drm.h" -extern const struct dri_extension amd_card_extensions[]; +extern const struct dri_extension radeon_card_extensions[]; -static const __DRIextension *amd_screen_extensions[] = { +static const __DRIextension *radeon_screen_extensions[] = { &driReadDrawableExtension, &driCopySubBufferExtension.base, &driSwapControlExtension.base, @@ -57,7 +57,7 @@ static const __DRIextension *amd_screen_extensions[] = { NULL }; -static __DRIconfig **amd_fill_in_modes(unsigned pixel_bits, +static __DRIconfig **radeon_fill_in_modes(unsigned pixel_bits, unsigned depth_bits, GLboolean have_back_buffer) { @@ -116,18 +116,18 @@ static __DRIconfig **amd_fill_in_modes(unsigned pixel_bits, return configs; } -static void amd_screen_destroy(__DRIscreenPrivate *dri_screen) +static void radeon_screen_destroy(__DRIscreenPrivate *dri_screen) { - struct amd_screen *amd_screen = (struct amd_screen*)dri_screen->private; + struct radeon_screen *radeon_screen = (struct radeon_screen*)dri_screen->private; - radeon_bo_manager_gem_dtor(amd_screen->bom); + radeon_bo_manager_gem_dtor(radeon_screen->bom); dri_screen = NULL; - free(amd_screen); + free(radeon_screen); } -static const __DRIconfig **amd_screen_init(__DRIscreenPrivate *dri_screen) +static const __DRIconfig **radeon_screen_init(__DRIscreenPrivate *dri_screen) { - struct amd_screen *amd_screen; + struct radeon_screen *radeon_screen; /* Calling driInitExtensions here, with a NULL context pointer, * does not actually enable the extensions. It just makes sure @@ -139,28 +139,28 @@ static const __DRIconfig **amd_screen_init(__DRIscreenPrivate *dri_screen) * * Hello chicken. Hello egg. How are you two today? */ - driInitExtensions(NULL, amd_card_extensions, GL_FALSE); + driInitExtensions(NULL, radeon_card_extensions, GL_FALSE); - amd_screen = calloc(1, sizeof(struct amd_screen)); - if (amd_screen == NULL) { + radeon_screen = calloc(1, sizeof(struct radeon_screen)); + if (radeon_screen == NULL) { fprintf(stderr, "\nERROR! Allocating private area failed\n"); return NULL; } - dri_screen->private = (void*)amd_screen; - dri_screen->extensions = amd_screen_extensions; - amd_screen->dri_screen = dri_screen; + dri_screen->private = (void*)radeon_screen; + dri_screen->extensions = radeon_screen_extensions; + radeon_screen->dri_screen = dri_screen; - amd_screen->bom = radeon_bo_manager_gem_ctor(dri_screen->fd); - if (amd_screen->bom == NULL) { - amd_screen_destroy(dri_screen); + radeon_screen->bom = radeon_bo_manager_gem_ctor(dri_screen->fd); + if (radeon_screen->bom == NULL) { + radeon_screen_destroy(dri_screen); return NULL; } - return driConcatConfigs(amd_fill_in_modes(16, 16, 1), - amd_fill_in_modes(32, 24, 1)); + return driConcatConfigs(radeon_fill_in_modes(16, 16, 1), + radeon_fill_in_modes(32, 24, 1)); } -static boolean amd_buffer_create(__DRIscreenPrivate *dri_screen, +static boolean radeon_buffer_create(__DRIscreenPrivate *dri_screen, __DRIdrawablePrivate *dri_drawable, const __GLcontextModes *visual, boolean is_pixmap) @@ -170,10 +170,10 @@ static boolean amd_buffer_create(__DRIscreenPrivate *dri_screen, return GL_FALSE; } else { enum pipe_format color_format, depth_format, stencil_format; - struct amd_framebuffer *amd_fb; + struct radeon_framebuffer *radeon_fb; - amd_fb = calloc(1, sizeof(struct amd_framebuffer)); - if (amd_fb == NULL) { + radeon_fb = calloc(1, sizeof(struct radeon_framebuffer)); + if (radeon_fb == NULL) { return GL_FALSE; } @@ -209,57 +209,57 @@ static boolean amd_buffer_create(__DRIscreenPrivate *dri_screen, break; } - amd_fb->st_framebuffer = st_create_framebuffer(visual, + radeon_fb->st_framebuffer = st_create_framebuffer(visual, color_format, depth_format, stencil_format, dri_drawable->w, dri_drawable->h, - (void*)amd_fb); - if (amd_fb->st_framebuffer == NULL) { - free(amd_fb); + (void*)radeon_fb); + if (radeon_fb->st_framebuffer == NULL) { + free(radeon_fb); return GL_FALSE; } - dri_drawable->driverPrivate = (void *) amd_fb; + dri_drawable->driverPrivate = (void *) radeon_fb; - amd_fb->attachments = (1 << __DRI_BUFFER_FRONT_LEFT); + radeon_fb->attachments = (1 << __DRI_BUFFER_FRONT_LEFT); if (visual->doubleBufferMode) { - amd_fb->attachments |= (1 << __DRI_BUFFER_BACK_LEFT); + radeon_fb->attachments |= (1 << __DRI_BUFFER_BACK_LEFT); } if (visual->depthBits || visual->stencilBits) { - amd_fb->attachments |= (1 << __DRI_BUFFER_DEPTH); + radeon_fb->attachments |= (1 << __DRI_BUFFER_DEPTH); } return GL_TRUE; } } -static void amd_buffer_destroy(__DRIdrawablePrivate * dri_drawable) +static void radeon_buffer_destroy(__DRIdrawablePrivate * dri_drawable) { - struct amd_framebuffer *amd_fb; + struct radeon_framebuffer *radeon_fb; - amd_fb = dri_drawable->driverPrivate; - assert(amd_fb->st_framebuffer); - st_unreference_framebuffer(amd_fb->st_framebuffer); - free(amd_fb); + radeon_fb = dri_drawable->driverPrivate; + assert(radeon_fb->st_framebuffer); + st_unreference_framebuffer(radeon_fb->st_framebuffer); + free(radeon_fb); } -static void amd_swap_buffers(__DRIdrawablePrivate *dri_drawable) +static void radeon_swap_buffers(__DRIdrawablePrivate *dri_drawable) { - struct amd_framebuffer *amd_fb; + struct radeon_framebuffer *radeon_fb; struct pipe_surface *back_surf = NULL; - amd_fb = dri_drawable->driverPrivate; - assert(amd_fb); - assert(amd_fb->st_framebuffer); + radeon_fb = dri_drawable->driverPrivate; + assert(radeon_fb); + assert(radeon_fb->st_framebuffer); - st_get_framebuffer_surface(amd_fb->st_framebuffer, + st_get_framebuffer_surface(radeon_fb->st_framebuffer, ST_SURFACE_BACK_LEFT, &back_surf); if (back_surf) { - st_notify_swapbuffers(amd_fb->st_framebuffer); + st_notify_swapbuffers(radeon_fb->st_framebuffer); /* TODO: do we want to do anythings ? */ - st_notify_swapbuffers_complete(amd_fb->st_framebuffer); + st_notify_swapbuffers_complete(radeon_fb->st_framebuffer); } } @@ -267,7 +267,7 @@ static void amd_swap_buffers(__DRIdrawablePrivate *dri_drawable) * Called via glXCopySubBufferMESA() to copy a subrect of the back * buffer to the front buffer/screen. */ -static void amd_copy_sub_buffer(__DRIdrawablePrivate *dri_drawable, +static void radeon_copy_sub_buffer(__DRIdrawablePrivate *dri_drawable, int x, int y, int w, int h) { /* TODO: ... */ @@ -275,14 +275,14 @@ static void amd_copy_sub_buffer(__DRIdrawablePrivate *dri_drawable, const struct __DriverAPIRec driDriverAPI = { .InitScreen = NULL, - .DestroyScreen = amd_screen_destroy, - .CreateContext = amd_context_create, - .DestroyContext = amd_context_destroy, - .CreateBuffer = amd_buffer_create, - .DestroyBuffer = amd_buffer_destroy, - .SwapBuffers = amd_swap_buffers, - .MakeCurrent = amd_context_bind, - .UnbindContext = amd_context_unbind, - .CopySubBuffer = amd_copy_sub_buffer, - .InitScreen2 = amd_screen_init, + .DestroyScreen = radeon_screen_destroy, + .CreateContext = radeon_context_create, + .DestroyContext = radeon_context_destroy, + .CreateBuffer = radeon_buffer_create, + .DestroyBuffer = radeon_buffer_destroy, + .SwapBuffers = radeon_swap_buffers, + .MakeCurrent = radeon_context_bind, + .UnbindContext = radeon_context_unbind, + .CopySubBuffer = radeon_copy_sub_buffer, + .InitScreen2 = radeon_screen_init, }; diff --git a/src/gallium/winsys/drm/amd/amd_screen.h b/src/gallium/winsys/drm/radeon/radeon_screen.h similarity index 95% rename from src/gallium/winsys/drm/amd/amd_screen.h rename to src/gallium/winsys/drm/radeon/radeon_screen.h index 2617393f2e1..01b7fa6531d 100644 --- a/src/gallium/winsys/drm/amd/amd_screen.h +++ b/src/gallium/winsys/drm/radeon/radeon_screen.h @@ -27,13 +27,13 @@ * Authors: * Jérôme Glisse */ -#ifndef AMD_SCREEN_H -#define AMD_SCREEN_H +#ifndef RADEON_SCREEN_H +#define RADEON_SCREEN_H #include "dri_util.h" #include "radeon_bo.h" -struct amd_screen { +struct radeon_screen { __DRIscreenPrivate *dri_screen; struct radeon_bo_manager *bom; }; diff --git a/src/gallium/winsys/drm/amd/amd_winsys_softpipe.c b/src/gallium/winsys/drm/radeon/radeon_winsys_softpipe.c similarity index 71% rename from src/gallium/winsys/drm/amd/amd_winsys_softpipe.c rename to src/gallium/winsys/drm/radeon/radeon_winsys_softpipe.c index b9b2a0e8b80..8402e1fa5a8 100644 --- a/src/gallium/winsys/drm/amd/amd_winsys_softpipe.c +++ b/src/gallium/winsys/drm/radeon/radeon_winsys_softpipe.c @@ -33,18 +33,18 @@ #include "pipe/p_defines.h" #include "pipe/p_format.h" #include "softpipe/sp_winsys.h" -#include "amd_context.h" -#include "amd_winsys_softpipe.h" +#include "radeon_context.h" +#include "radeon_winsys_softpipe.h" -struct amd_softpipe_winsys { +struct radeon_softpipe_winsys { struct softpipe_winsys sp_winsys; - struct amd_context *amd_context; + struct radeon_context *radeon_context; }; /** * Return list of surface formats supported by this driver. */ -static boolean amd_is_format_supported(struct softpipe_winsys *sws, uint format) +static boolean radeon_is_format_supported(struct softpipe_winsys *sws, uint format) { switch (format) { case PIPE_FORMAT_A8R8G8B8_UNORM: @@ -57,21 +57,21 @@ static boolean amd_is_format_supported(struct softpipe_winsys *sws, uint format) return FALSE; } -struct pipe_context *amd_create_softpipe(struct amd_context *amd_context) +struct pipe_context *radeon_create_softpipe(struct radeon_context *radeon_context) { - struct amd_softpipe_winsys *amd_sp_ws; + struct radeon_softpipe_winsys *radeon_sp_ws; struct pipe_screen *pipe_screen; - pipe_screen = softpipe_create_screen(amd_context->pipe_winsys); + pipe_screen = softpipe_create_screen(radeon_context->pipe_winsys); - amd_sp_ws = CALLOC_STRUCT(amd_softpipe_winsys); - if (amd_sp_ws == NULL) { + radeon_sp_ws = CALLOC_STRUCT(radeon_softpipe_winsys); + if (radeon_sp_ws == NULL) { return NULL; } - amd_context->pipe_screen = pipe_screen; - amd_sp_ws->amd_context = amd_context; - amd_sp_ws->sp_winsys.is_format_supported = amd_is_format_supported; + radeon_context->pipe_screen = pipe_screen; + radeon_sp_ws->radeon_context = radeon_context; + radeon_sp_ws->sp_winsys.is_format_supported = radeon_is_format_supported; return softpipe_create(pipe_screen, - amd_context->pipe_winsys, - &amd_sp_ws->sp_winsys); + radeon_context->pipe_winsys, + &radeon_sp_ws->sp_winsys); } diff --git a/src/gallium/winsys/drm/amd/amd_winsys_softpipe.h b/src/gallium/winsys/drm/radeon/radeon_winsys_softpipe.h similarity index 87% rename from src/gallium/winsys/drm/amd/amd_winsys_softpipe.h rename to src/gallium/winsys/drm/radeon/radeon_winsys_softpipe.h index e5b68cf8a54..519eab769c8 100644 --- a/src/gallium/winsys/drm/amd/amd_winsys_softpipe.h +++ b/src/gallium/winsys/drm/radeon/radeon_winsys_softpipe.h @@ -27,11 +27,11 @@ * Authors: * Jérôme Glisse */ -#ifndef AMD_WINSYS_SOFTPIPE_H -#define AMD_WINSYS_SOFTPIPE_H +#ifndef RADEON_WINSYS_SOFTPIPE_H +#define RADEON_WINSYS_SOFTPIPE_H -#include "amd_context.h" +#include "radeon_context.h" -struct pipe_context *amd_create_softpipe(struct amd_context *amd_context); +struct pipe_context *radeon_create_softpipe(struct radeon_context *radeon_context); #endif -- 2.30.2