struct __DRIimageLookupExtensionRec {
__DRIextension base;
- __DRIimage *(*lookupEGLImage)(__DRIcontext *context, void *image,
+ __DRIimage *(*lookupEGLImage)(__DRIscreen *screen, void *image,
void *loaderPrivate);
};
}
static __DRIimage *
-dri2_lookup_egl_image(__DRIcontext *context, void *image, void *data)
+dri2_lookup_egl_image(__DRIscreen *screen, void *image, void *data)
{
- struct dri2_egl_context *dri2_ctx = data;
- _EGLDisplay *disp = dri2_ctx->base.Resource.Display;
+ _EGLDisplay *disp = data;
struct dri2_egl_image *dri2_img;
_EGLImage *img;
dri2_dpy = disp->DriverData;
dri2_dpy->dri_screen =
dri2_dpy->dri2->createNewScreen(0, dri2_dpy->fd, dri2_dpy->extensions,
- &dri2_dpy->driver_configs, dri2_dpy);
+ &dri2_dpy->driver_configs, disp);
if (dri2_dpy->dri_screen == NULL) {
_eglLog(_EGL_WARNING, "DRI2: failed to create dri screen");
* This function is optional.
*/
boolean (*get_egl_image)(struct st_manager *smapi,
- struct st_context_iface *stctx,
void *egl_image,
struct st_egl_image *out);
/* gallium */
struct st_api *stapi;
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 *
static boolean
dri_get_egl_image(struct st_manager *smapi,
- struct st_context_iface *stctxi,
void *egl_image,
struct st_egl_image *stimg)
{
- struct dri_context *ctx =
- (struct dri_context *)stctxi->st_manager_private;
+ struct dri_screen *screen = (struct dri_screen *)smapi;
__DRIimage *img = NULL;
- if (ctx->lookup_egl_image) {
- img = ctx->lookup_egl_image(ctx, egl_image);
+ if (screen->lookup_egl_image) {
+ img = screen->lookup_egl_image(screen, egl_image);
}
if (!img)
boolean sd_depth_bits_last;
boolean auto_fake_front;
enum pipe_texture_target target;
+
+ /* hooks filled in by dri2 & drisw */
+ __DRIimage * (*lookup_egl_image)(struct dri_screen *ctx, void *handle);
};
/** cast wrapper */
}
static __DRIimage *
-dri2_lookup_egl_image(struct dri_context *ctx, void *handle)
+dri2_lookup_egl_image(struct dri_screen *screen, void *handle)
{
- __DRIimageLookupExtension *loader = ctx->sPriv->dri2.image;
+ __DRIimageLookupExtension *loader = screen->sPriv->dri2.image;
__DRIimage *img;
if (!loader->lookupEGLImage)
return NULL;
- img = loader->lookupEGLImage(ctx->cPriv, handle, ctx->cPriv->loaderPrivate);
+ img = loader->lookupEGLImage(screen->sPriv,
+ handle, screen->sPriv->loaderPrivate);
return img;
}
screen->auto_fake_front = dri_with_format(sPriv);
screen->broken_invalidate = !sPriv->dri2.useInvalidate;
+ screen->lookup_egl_image = dri2_lookup_egl_image;
return configs;
fail:
ctx = cPriv->driverPrivate;
- ctx->lookup_egl_image = dri2_lookup_egl_image;
-
return TRUE;
}
}
psp->DriverAPI = driDriverAPI;
+ psp->loaderPrivate = data;
driParseOptionInfo(&psp->optionInfo, __dri2ConfigOptions,
__dri2NConfigOptions);
driOptionCache optionInfo;
driOptionCache optionCache;
unsigned int api_mask;
+ void *loaderPrivate;
};
extern void
__DRIimage *image;
screen = intel->intelScreen->driScrnPriv;
- image = screen->dri2.image->lookupEGLImage(intel->driContext, image_handle,
- intel->driContext->loaderPrivate);
+ image = screen->dri2.image->lookupEGLImage(screen, image_handle,
+ screen->loaderPrivate);
if (image == NULL)
return;
__DRIimage *image;
screen = intel->intelScreen->driScrnPriv;
- image = screen->dri2.image->lookupEGLImage(intel->driContext, image_handle,
- intel->driContext->loaderPrivate);
+ image = screen->dri2.image->lookupEGLImage(screen, image_handle,
+ screen->loaderPrivate);
if (image == NULL)
return;