summaryrefslogtreecommitdiff
path: root/src/gallium/state_trackers/dri/common
diff options
context:
space:
mode:
authorGeorge Sapountzis <gsapountzis@gmail.com>2010-07-18 18:23:36 +0300
committerGeorge Sapountzis <gsapountzis@gmail.com>2010-07-30 23:43:26 +0300
commit873ddf547d5aeb68f37a172d73131c6bc51101f6 (patch)
treea8f9253527ccc3d1a4661438b8567ad290257995 /src/gallium/state_trackers/dri/common
parenta30b966f8345cb99922a416fce2da6edb70f864c (diff)
st/dri: move backend hooks to appropriate object
Diffstat (limited to 'src/gallium/state_trackers/dri/common')
-rw-r--r--src/gallium/state_trackers/dri/common/dri_context.h3
-rw-r--r--src/gallium/state_trackers/dri/common/dri_drawable.c9
-rw-r--r--src/gallium/state_trackers/dri/common/dri_drawable.h10
-rw-r--r--src/gallium/state_trackers/dri/common/dri_screen.c5
-rw-r--r--src/gallium/state_trackers/dri/common/dri_screen.h9
5 files changed, 19 insertions, 17 deletions
diff --git a/src/gallium/state_trackers/dri/common/dri_context.h b/src/gallium/state_trackers/dri/common/dri_context.h
index b29e853383..692c49d7cd 100644
--- a/src/gallium/state_trackers/dri/common/dri_context.h
+++ b/src/gallium/state_trackers/dri/common/dri_context.h
@@ -60,6 +60,9 @@ struct dri_context
/* gallium */
struct st_context_iface *st;
+
+ /* hooks filled in by dri2 & drisw */
+ __DRIimage * (*lookup_egl_image)(struct dri_context *ctx, void *handle);
};
static INLINE struct dri_context *
diff --git a/src/gallium/state_trackers/dri/common/dri_drawable.c b/src/gallium/state_trackers/dri/common/dri_drawable.c
index be824e7e3f..88b79a0a76 100644
--- a/src/gallium/state_trackers/dri/common/dri_drawable.c
+++ b/src/gallium/state_trackers/dri/common/dri_drawable.c
@@ -67,10 +67,10 @@ dri_st_framebuffer_validate(struct st_framebuffer_iface *stfbi,
new_stamp = (drawable->texture_stamp != drawable->dPriv->lastStamp);
if (new_stamp || new_mask || screen->broken_invalidate) {
- if (new_stamp && screen->update_drawable_info)
- screen->update_drawable_info(drawable);
+ if (new_stamp && drawable->update_drawable_info)
+ drawable->update_drawable_info(drawable);
- screen->allocate_textures(drawable, statts, count);
+ drawable->allocate_textures(drawable, statts, count);
/* add existing textures */
for (i = 0; i < ST_ATTACHMENT_COUNT; i++) {
@@ -99,10 +99,9 @@ dri_st_framebuffer_flush_front(struct st_framebuffer_iface *stfbi,
{
struct dri_drawable *drawable =
(struct dri_drawable *) stfbi->st_manager_private;
- struct dri_screen *screen = dri_screen(drawable->sPriv);
/* XXX remove this and just set the correct one on the framebuffer */
- screen->flush_frontbuffer(drawable, statt);
+ drawable->flush_frontbuffer(drawable, statt);
return TRUE;
}
diff --git a/src/gallium/state_trackers/dri/common/dri_drawable.h b/src/gallium/state_trackers/dri/common/dri_drawable.h
index 62c7b0d41a..3f2e24fc15 100644
--- a/src/gallium/state_trackers/dri/common/dri_drawable.h
+++ b/src/gallium/state_trackers/dri/common/dri_drawable.h
@@ -55,6 +55,16 @@ struct dri_drawable
/* used only by DRISW */
struct pipe_surface *drisw_surface;
+
+ /* hooks filled in by dri2 & drisw */
+ void (*allocate_textures)(struct dri_drawable *drawable,
+ const enum st_attachment_type *statts,
+ unsigned count);
+
+ void (*update_drawable_info)(struct dri_drawable *drawable);
+
+ void (*flush_frontbuffer)(struct dri_drawable *drawable,
+ enum st_attachment_type statt);
};
static INLINE struct dri_drawable *
diff --git a/src/gallium/state_trackers/dri/common/dri_screen.c b/src/gallium/state_trackers/dri/common/dri_screen.c
index ed302e37c1..e869b4b9b1 100644
--- a/src/gallium/state_trackers/dri/common/dri_screen.c
+++ b/src/gallium/state_trackers/dri/common/dri_screen.c
@@ -294,11 +294,10 @@ dri_get_egl_image(struct st_manager *smapi,
{
struct dri_context *ctx =
(struct dri_context *)stctxi->st_manager_private;
- struct dri_screen *screen = dri_screen(ctx->sPriv);
__DRIimage *img = NULL;
- if (screen->lookup_egl_image) {
- img = screen->lookup_egl_image(ctx, egl_image);
+ if (ctx->lookup_egl_image) {
+ img = ctx->lookup_egl_image(ctx, egl_image);
}
if (!img)
diff --git a/src/gallium/state_trackers/dri/common/dri_screen.h b/src/gallium/state_trackers/dri/common/dri_screen.h
index e27ff9d98e..53ccce145b 100644
--- a/src/gallium/state_trackers/dri/common/dri_screen.h
+++ b/src/gallium/state_trackers/dri/common/dri_screen.h
@@ -64,15 +64,6 @@ struct dri_screen
int fd;
drmLock *drmLock;
- /* hooks filled in by dri2 & drisw */
- __DRIimage * (*lookup_egl_image)(struct dri_context *ctx, void *handle);
- void (*allocate_textures)(struct dri_drawable *drawable,
- const enum st_attachment_type *statts,
- unsigned count);
- void (*update_drawable_info)(struct dri_drawable *drawable);
- void (*flush_frontbuffer)(struct dri_drawable *drawable,
- enum st_attachment_type statt);
-
/* gallium */
boolean d_depth_bits_last;
boolean sd_depth_bits_last;