struct brw_context *brw = brw_context(ctx);
__DRIcontext *driContext = brw->driContext;
__DRIdrawable *driDrawable = driContext->driDrawablePriv;
- __DRIscreen *const screen = brw->intelScreen->driScrnPriv;
+ __DRIscreen *const dri_screen = brw->intelScreen->driScrnPriv;
if (brw->front_buffer_dirty && _mesa_is_winsys_fbo(ctx->DrawBuffer)) {
- if (flushFront(screen) && driDrawable &&
+ if (flushFront(dri_screen) && driDrawable &&
driDrawable->loaderPrivate) {
/* Resolve before flushing FAKE_FRONT_LEFT to FRONT_LEFT.
intel_resolve_for_dri2_flush(brw, driDrawable);
intel_batchbuffer_flush(brw);
- flushFront(screen)(driDrawable, driDrawable->loaderPrivate);
+ flushFront(dri_screen)(driDrawable, driDrawable->loaderPrivate);
/* We set the dirty bit in intel_prepare_render() if we're
* front buffer rendering once we get there.
unsigned *dri_ctx_error,
void *sharedContextPrivate)
{
- __DRIscreen *sPriv = driContextPriv->driScreenPriv;
struct gl_context *shareCtx = (struct gl_context *) sharedContextPrivate;
- struct intel_screen *screen = sPriv->driverPrivate;
+ struct intel_screen *screen = driContextPriv->driScreenPriv->driverPrivate;
const struct gen_device_info *devinfo = screen->devinfo;
struct dd_function_table functions;
intel_update_renderbuffers(__DRIcontext *context, __DRIdrawable *drawable)
{
struct brw_context *brw = context->driverPrivate;
- __DRIscreen *screen = brw->intelScreen->driScrnPriv;
+ __DRIscreen *dri_screen = brw->intelScreen->driScrnPriv;
/* Set this up front, so that in case our buffers get invalidated
* while we're getting new buffers, we don't clobber the stamp and
if (unlikely(INTEL_DEBUG & DEBUG_DRI))
fprintf(stderr, "enter %s, drawable %p\n", __func__, drawable);
- if (screen->image.loader)
+ if (dri_screen->image.loader)
intel_update_image_buffers(brw, drawable);
else
intel_update_dri2_buffers(brw, drawable);
__DRIbuffer **buffers,
int *buffer_count)
{
- __DRIscreen *screen = brw->intelScreen->driScrnPriv;
+ __DRIscreen *dri_screen = brw->intelScreen->driScrnPriv;
struct gl_framebuffer *fb = drawable->driverPrivate;
int i = 0;
unsigned attachments[8];
assert(i <= ARRAY_SIZE(attachments));
- *buffers = screen->dri2.loader->getBuffersWithFormat(drawable,
- &drawable->w,
- &drawable->h,
- attachments, i / 2,
- buffer_count,
- drawable->loaderPrivate);
+ *buffers =
+ dri_screen->dri2.loader->getBuffersWithFormat(drawable,
+ &drawable->w,
+ &drawable->h,
+ attachments, i / 2,
+ buffer_count,
+ drawable->loaderPrivate);
}
/**
intel_update_image_buffers(struct brw_context *brw, __DRIdrawable *drawable)
{
struct gl_framebuffer *fb = drawable->driverPrivate;
- __DRIscreen *screen = brw->intelScreen->driScrnPriv;
+ __DRIscreen *dri_screen = brw->intelScreen->driScrnPriv;
struct intel_renderbuffer *front_rb;
struct intel_renderbuffer *back_rb;
struct __DRIimageList images;
if (back_rb)
buffer_mask |= __DRI_IMAGE_BUFFER_BACK;
- ret = screen->image.loader->getBuffers(drawable,
- driGLFormatToImageFormat(format),
- &drawable->dri2.stamp,
- drawable->loaderPrivate,
- buffer_mask,
- &images);
+ ret = dri_screen->image.loader->getBuffers(drawable,
+ driGLFormatToImageFormat(format),
+ &drawable->dri2.stamp,
+ drawable->loaderPrivate,
+ buffer_mask,
+ &images);
if (!ret)
return;
}
static __DRIimage *
-intel_create_image_from_name(__DRIscreen *screen,
+intel_create_image_from_name(__DRIscreen *dri_screen,
int width, int height, int format,
int name, int pitch, void *loaderPrivate)
{
- struct intel_screen *intelScreen = screen->driverPrivate;
+ struct intel_screen *intelScreen = dri_screen->driverPrivate;
__DRIimage *image;
int cpp;
}
static __DRIimage *
-intel_create_image(__DRIscreen *screen,
+intel_create_image(__DRIscreen *dri_screen,
int width, int height, int format,
unsigned int use,
void *loaderPrivate)
{
__DRIimage *image;
- struct intel_screen *intelScreen = screen->driverPrivate;
+ struct intel_screen *intelScreen = dri_screen->driverPrivate;
uint32_t tiling;
int cpp;
unsigned long pitch;
}
static __DRIimage *
-intel_create_image_from_names(__DRIscreen *screen,
+intel_create_image_from_names(__DRIscreen *dri_screen,
int width, int height, int fourcc,
int *names, int num_names,
int *strides, int *offsets,
__DRIimage *image;
int i, index;
- if (screen == NULL || names == NULL || num_names != 1)
+ if (dri_screen == NULL || names == NULL || num_names != 1)
return NULL;
f = intel_image_format_lookup(fourcc);
if (f == NULL)
return NULL;
- image = intel_create_image_from_name(screen, width, height,
+ image = intel_create_image_from_name(dri_screen, width, height,
__DRI_IMAGE_FORMAT_NONE,
names[0], strides[0],
loaderPrivate);
}
static __DRIimage *
-intel_create_image_from_fds(__DRIscreen *screen,
+intel_create_image_from_fds(__DRIscreen *dri_screen,
int width, int height, int fourcc,
int *fds, int num_fds, int *strides, int *offsets,
void *loaderPrivate)
{
- struct intel_screen *intelScreen = screen->driverPrivate;
+ struct intel_screen *intelScreen = dri_screen->driverPrivate;
struct intel_image_format *f;
__DRIimage *image;
int i, index;
}
static __DRIimage *
-intel_create_image_from_dma_bufs(__DRIscreen *screen,
+intel_create_image_from_dma_bufs(__DRIscreen *dri_screen,
int width, int height, int fourcc,
int *fds, int num_fds,
int *strides, int *offsets,
return NULL;
}
- image = intel_create_image_from_fds(screen, width, height, fourcc, fds,
+ image = intel_create_image_from_fds(dri_screen, width, height, fourcc, fds,
num_fds, strides, offsets,
loaderPrivate);
};
static int
-brw_query_renderer_integer(__DRIscreen *psp, int param, unsigned int *value)
+brw_query_renderer_integer(__DRIscreen *dri_screen,
+ int param, unsigned int *value)
{
const struct intel_screen *const intelScreen =
- (struct intel_screen *) psp->driverPrivate;
+ (struct intel_screen *) dri_screen->driverPrivate;
switch (param) {
case __DRI2_RENDERER_VENDOR_ID:
size_t aper_size;
size_t mappable_size;
- drm_intel_get_aperture_sizes(psp->fd, &mappable_size, &aper_size);
+ drm_intel_get_aperture_sizes(dri_screen->fd, &mappable_size, &aper_size);
const unsigned gpu_mappable_megabytes =
(aper_size / (1024 * 1024)) * 3 / 4;
value[0] = 1;
return 0;
default:
- return driQueryRendererIntegerCommon(psp, param, value);
+ return driQueryRendererIntegerCommon(dri_screen, param, value);
}
return -1;
}
static int
-brw_query_renderer_string(__DRIscreen *psp, int param, const char **value)
+brw_query_renderer_string(__DRIscreen *dri_screen,
+ int param, const char **value)
{
const struct intel_screen *intelScreen =
- (struct intel_screen *) psp->driverPrivate;
+ (struct intel_screen *) dri_screen->driverPrivate;
switch (param) {
case __DRI2_RENDERER_VENDOR_ID:
* This is called when we need to set up GL rendering to a new X window.
*/
static GLboolean
-intelCreateBuffer(__DRIscreen * driScrnPriv,
+intelCreateBuffer(__DRIscreen *dri_screen,
__DRIdrawable * driDrawPriv,
const struct gl_config * mesaVis, GLboolean isPixmap)
{
struct intel_renderbuffer *rb;
- struct intel_screen *screen = (struct intel_screen*) driScrnPriv->driverPrivate;
+ struct intel_screen *screen = (struct intel_screen *)
+ dri_screen->driverPrivate;
mesa_format rgbFormat;
- unsigned num_samples = intel_quantize_num_samples(screen, mesaVis->samples);
+ unsigned num_samples =
+ intel_quantize_num_samples(screen, mesaVis->samples);
struct gl_framebuffer *fb;
if (isPixmap)
static bool
intel_init_bufmgr(struct intel_screen *intelScreen)
{
- __DRIscreen *spriv = intelScreen->driScrnPriv;
+ __DRIscreen *dri_screen = intelScreen->driScrnPriv;
intelScreen->no_hw = getenv("INTEL_NO_HW") != NULL;
- intelScreen->bufmgr = intel_bufmgr_gem_init(spriv->fd, BATCH_SZ);
+ intelScreen->bufmgr = intel_bufmgr_gem_init(dri_screen->fd, BATCH_SZ);
if (intelScreen->bufmgr == NULL) {
fprintf(stderr, "[%s:%u] Error initializing buffer manager.\n",
__func__, __LINE__);
static void
set_max_gl_versions(struct intel_screen *screen)
{
- __DRIscreen *psp = screen->driScrnPriv;
+ __DRIscreen *dri_screen = screen->driScrnPriv;
switch (screen->devinfo->gen) {
case 9:
case 8:
- psp->max_gl_core_version = 44;
- psp->max_gl_compat_version = 30;
- psp->max_gl_es1_version = 11;
- psp->max_gl_es2_version = 31;
+ dri_screen->max_gl_core_version = 44;
+ dri_screen->max_gl_compat_version = 30;
+ dri_screen->max_gl_es1_version = 11;
+ dri_screen->max_gl_es2_version = 31;
break;
case 7:
- psp->max_gl_core_version = 33;
- psp->max_gl_compat_version = 30;
- psp->max_gl_es1_version = 11;
- psp->max_gl_es2_version = screen->devinfo->is_haswell ? 31 : 30;
+ dri_screen->max_gl_core_version = 33;
+ dri_screen->max_gl_compat_version = 30;
+ dri_screen->max_gl_es1_version = 11;
+ dri_screen->max_gl_es2_version = screen->devinfo->is_haswell ? 31 : 30;
break;
case 6:
- psp->max_gl_core_version = 33;
- psp->max_gl_compat_version = 30;
- psp->max_gl_es1_version = 11;
- psp->max_gl_es2_version = 30;
+ dri_screen->max_gl_core_version = 33;
+ dri_screen->max_gl_compat_version = 30;
+ dri_screen->max_gl_es1_version = 11;
+ dri_screen->max_gl_es2_version = 30;
break;
case 5:
case 4:
- psp->max_gl_core_version = 0;
- psp->max_gl_compat_version = 21;
- psp->max_gl_es1_version = 11;
- psp->max_gl_es2_version = 20;
+ dri_screen->max_gl_core_version = 0;
+ dri_screen->max_gl_compat_version = 21;
+ dri_screen->max_gl_es1_version = 11;
+ dri_screen->max_gl_es2_version = 20;
break;
default:
unreachable("unrecognized intel_screen::gen");
* \return the struct gl_config supported by this driver
*/
static const
-__DRIconfig **intelInitScreen2(__DRIscreen *psp)
+__DRIconfig **intelInitScreen2(__DRIscreen *dri_screen)
{
struct intel_screen *intelScreen;
- if (psp->image.loader) {
- } else if (psp->dri2.loader->base.version <= 2 ||
- psp->dri2.loader->getBuffersWithFormat == NULL) {
+ if (dri_screen->image.loader) {
+ } else if (dri_screen->dri2.loader->base.version <= 2 ||
+ dri_screen->dri2.loader->getBuffersWithFormat == NULL) {
fprintf(stderr,
"\nERROR! DRI2 loader with getBuffersWithFormat() "
"support required\n");
/* parse information in __driConfigOptions */
driParseOptionInfo(&intelScreen->optionCache, brw_config_options.xml);
- intelScreen->driScrnPriv = psp;
- psp->driverPrivate = (void *) intelScreen;
+ intelScreen->driScrnPriv = dri_screen;
+ dri_screen->driverPrivate = (void *) intelScreen;
if (!intel_init_bufmgr(intelScreen))
return false;
struct drm_i915_reset_stats stats;
memset(&stats, 0, sizeof(stats));
- const int ret = drmIoctl(psp->fd, DRM_IOCTL_I915_GET_RESET_STATS, &stats);
+ const int ret = drmIoctl(dri_screen->fd, DRM_IOCTL_I915_GET_RESET_STATS, &stats);
intelScreen->has_context_reset_notification =
(ret != -1 || errno != EINVAL);
(intelScreen->devinfo->is_haswell &&
intelScreen->cmd_parser_version >= 7);
- psp->extensions = !intelScreen->has_context_reset_notification
+ dri_screen->extensions = !intelScreen->has_context_reset_notification
? intelScreenExtensions : intelRobustScreenExtensions;
intelScreen->compiler = brw_compiler_create(intelScreen,
intel_get_boolean(intelScreen, I915_PARAM_HAS_RESOURCE_STREAMER);
}
- return (const __DRIconfig**) intel_screen_make_configs(psp);
+ return (const __DRIconfig**) intel_screen_make_configs(dri_screen);
}
struct intel_buffer {
};
static __DRIbuffer *
-intelAllocateBuffer(__DRIscreen *screen,
+intelAllocateBuffer(__DRIscreen *dri_screen,
unsigned attachment, unsigned format,
int width, int height)
{
struct intel_buffer *intelBuffer;
- struct intel_screen *intelScreen = screen->driverPrivate;
+ struct intel_screen *intelScreen = dri_screen->driverPrivate;
assert(attachment == __DRI_BUFFER_FRONT_LEFT ||
attachment == __DRI_BUFFER_BACK_LEFT);
}
static void
-intelReleaseBuffer(__DRIscreen *screen, __DRIbuffer *buffer)
+intelReleaseBuffer(__DRIscreen *dri_screen, __DRIbuffer *buffer)
{
struct intel_buffer *intelBuffer = (struct intel_buffer *) buffer;