i965: Move intel_context::intelScreen to brw_context.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Chris Forbes <chrisf@ijw.co.nz>
Acked-by: Paul Berry <stereotype441@gmail.com>
Acked-by: Anuj Phogat <anuj.phogat@gmail.com>
This commit is contained in:
Kenneth Graunke 2013-07-03 14:55:19 -07:00
parent 44a11eab9c
commit 02128c448d
9 changed files with 24 additions and 30 deletions

View file

@ -1225,6 +1225,7 @@ struct brw_context
} shader_time;
__DRIcontext *driContext;
struct intel_screen *intelScreen;
};
/*======================================================================

View file

@ -78,7 +78,7 @@ static struct gl_program *brwNewProgram( struct gl_context *ctx,
case GL_VERTEX_PROGRAM_ARB: {
struct brw_vertex_program *prog = CALLOC_STRUCT(brw_vertex_program);
if (prog) {
prog->id = get_new_program_id(brw->intel.intelScreen);
prog->id = get_new_program_id(brw->intelScreen);
return _mesa_init_vertex_program( ctx, &prog->program,
target, id );
@ -90,7 +90,7 @@ static struct gl_program *brwNewProgram( struct gl_context *ctx,
case GL_FRAGMENT_PROGRAM_ARB: {
struct brw_fragment_program *prog = CALLOC_STRUCT(brw_fragment_program);
if (prog) {
prog->id = get_new_program_id(brw->intel.intelScreen);
prog->id = get_new_program_id(brw->intelScreen);
return _mesa_init_fragment_program( ctx, &prog->program,
target, id );
@ -135,7 +135,7 @@ brwProgramStringNotify(struct gl_context *ctx,
if (newFP == curFP)
brw->state.dirty.brw |= BRW_NEW_FRAGMENT_PROGRAM;
newFP->id = get_new_program_id(brw->intel.intelScreen);
newFP->id = get_new_program_id(brw->intelScreen);
break;
}
case GL_VERTEX_PROGRAM_ARB: {
@ -149,7 +149,7 @@ brwProgramStringNotify(struct gl_context *ctx,
if (newVP->program.IsPositionInvariant) {
_mesa_insert_mvp_code(ctx, &newVP->program);
}
newVP->id = get_new_program_id(brw->intel.intelScreen);
newVP->id = get_new_program_id(brw->intelScreen);
/* Also tell tnl about it:
*/

View file

@ -136,12 +136,11 @@ intel_batchbuffer_free(struct brw_context *brw)
static void
do_batch_dump(struct brw_context *brw)
{
struct intel_context *intel = &brw->intel;
struct drm_intel_decode *decode;
struct intel_batchbuffer *batch = &brw->batch;
int ret;
decode = drm_intel_decode_context_alloc(intel->intelScreen->deviceID);
decode = drm_intel_decode_context_alloc(brw->intelScreen->deviceID);
if (!decode)
return;
@ -194,7 +193,7 @@ do_flush_locked(struct brw_context *brw)
}
}
if (!intel->intelScreen->no_hw) {
if (!brw->intelScreen->no_hw) {
int flags;
if (intel->gen < 6 || !batch->is_blit) {

View file

@ -63,7 +63,7 @@ int INTEL_DEBUG = (0);
static const GLubyte *
intelGetString(struct gl_context * ctx, GLenum name)
{
const struct intel_context *const intel = intel_context(ctx);
const struct brw_context *const brw = brw_context(ctx);
const char *chipset;
static char buffer[128];
@ -73,7 +73,7 @@ intelGetString(struct gl_context * ctx, GLenum name)
break;
case GL_RENDERER:
switch (intel->intelScreen->deviceID) {
switch (brw->intelScreen->deviceID) {
#undef CHIPSET
#define CHIPSET(id, symbol, str) case id: chipset = str; break;
#include "pci_ids/i965_pci_ids.h"
@ -128,10 +128,9 @@ static void
intel_flush_front(struct gl_context *ctx)
{
struct brw_context *brw = brw_context(ctx);
struct intel_context *intel = intel_context(ctx);
__DRIcontext *driContext = brw->driContext;
__DRIdrawable *driDrawable = driContext->driDrawablePriv;
__DRIscreen *const screen = intel->intelScreen->driScrnPriv;
__DRIscreen *const screen = brw->intelScreen->driScrnPriv;
if (brw->front_buffer_dirty && _mesa_is_winsys_fbo(ctx->DrawBuffer)) {
if (screen->dri2.loader->flushFrontBuffer != NULL &&
@ -463,7 +462,7 @@ intelInitContext(struct brw_context *brw,
mesaVis = &visual;
}
intel->intelScreen = intelScreen;
brw->intelScreen = intelScreen;
if (!_mesa_initialize_context(&intel->ctx, api, mesaVis, shareCtx,
functions)) {
@ -496,11 +495,11 @@ intelInitContext(struct brw_context *brw,
intel->is_g4x = true;
}
intel->has_separate_stencil = intel->intelScreen->hw_has_separate_stencil;
intel->must_use_separate_stencil = intel->intelScreen->hw_must_use_separate_stencil;
intel->has_separate_stencil = brw->intelScreen->hw_has_separate_stencil;
intel->must_use_separate_stencil = brw->intelScreen->hw_must_use_separate_stencil;
intel->has_hiz = intel->gen >= 6;
intel->has_llc = intel->intelScreen->hw_has_llc;
intel->has_swizzling = intel->intelScreen->hw_has_swizzling;
intel->has_llc = brw->intelScreen->hw_has_llc;
intel->has_swizzling = brw->intelScreen->hw_has_swizzling;
memset(&ctx->TextureFormatSupported,
0, sizeof(ctx->TextureFormatSupported));
@ -778,7 +777,7 @@ intel_query_dri2_buffers(struct brw_context *brw,
int *buffer_count)
{
struct intel_context *intel = &brw->intel;
__DRIscreen *screen = intel->intelScreen->driScrnPriv;
__DRIscreen *screen = brw->intelScreen->driScrnPriv;
struct gl_framebuffer *fb = drawable->driverPrivate;
int i = 0;
unsigned attachments[8];
@ -852,7 +851,6 @@ intel_process_dri2_buffer(struct brw_context *brw,
struct intel_renderbuffer *rb,
const char *buffer_name)
{
struct intel_context *intel = &brw->intel;
struct intel_region *region = NULL;
if (!rb)
@ -885,7 +883,7 @@ intel_process_dri2_buffer(struct brw_context *brw,
}
intel_miptree_release(&rb->mt);
region = intel_region_alloc_for_handle(intel->intelScreen,
region = intel_region_alloc_for_handle(brw->intelScreen,
buffer->cpp,
drawable->w,
drawable->h,

View file

@ -126,8 +126,6 @@ struct intel_context
bool has_hiz;
bool has_llc;
bool has_swizzling;
struct intel_screen *intelScreen;
};
/**

View file

@ -193,7 +193,7 @@ intel_alloc_renderbuffer_storage(struct gl_context * ctx, struct gl_renderbuffer
{
struct brw_context *brw = brw_context(ctx);
struct intel_context *intel = intel_context(ctx);
struct intel_screen *screen = intel->intelScreen;
struct intel_screen *screen = brw->intelScreen;
struct intel_renderbuffer *irb = intel_renderbuffer(rb);
rb->NumSamples = intel_quantize_num_samples(screen, rb->NumSamples);
@ -252,12 +252,11 @@ intel_image_target_renderbuffer_storage(struct gl_context *ctx,
void *image_handle)
{
struct brw_context *brw = brw_context(ctx);
struct intel_context *intel = intel_context(ctx);
struct intel_renderbuffer *irb;
__DRIscreen *screen;
__DRIimage *image;
screen = intel->intelScreen->driScrnPriv;
screen = brw->intelScreen->driScrnPriv;
image = screen->dri2.image->lookupEGLImage(screen, image_handle,
screen->loaderPrivate);
if (image == NULL)

View file

@ -560,7 +560,7 @@ intel_miptree_create(struct brw_context *brw,
bool y_or_x = tiling == (I915_TILING_Y | I915_TILING_X);
mt->etc_format = etc_format;
mt->region = intel_region_alloc(intel->intelScreen,
mt->region = intel_region_alloc(brw->intelScreen,
y_or_x ? I915_TILING_Y : tiling,
mt->cpp,
total_width,
@ -576,7 +576,7 @@ intel_miptree_create(struct brw_context *brw,
mt->total_width, mt->total_height);
intel_region_release(&mt->region);
mt->region = intel_region_alloc(intel->intelScreen,
mt->region = intel_region_alloc(brw->intelScreen,
I915_TILING_X,
mt->cpp,
total_width,

View file

@ -61,7 +61,6 @@ intel_alloc_texture_image_buffer(struct gl_context *ctx,
struct gl_texture_image *image)
{
struct brw_context *brw = brw_context(ctx);
struct intel_context *intel = intel_context(ctx);
struct intel_texture_image *intel_image = intel_texture_image(image);
struct gl_texture_object *texobj = image->TexObject;
struct intel_texture_object *intel_texobj = intel_texture_object(texobj);
@ -70,7 +69,7 @@ intel_alloc_texture_image_buffer(struct gl_context *ctx,
/* Quantize sample count */
if (image->NumSamples) {
image->NumSamples = intel_quantize_num_samples(intel->intelScreen, image->NumSamples);
image->NumSamples = intel_quantize_num_samples(brw->intelScreen, image->NumSamples);
if (!image->NumSamples)
return false;
}

View file

@ -361,11 +361,11 @@ intel_image_target_texture_2d(struct gl_context *ctx, GLenum target,
struct gl_texture_image *texImage,
GLeglImageOES image_handle)
{
struct intel_context *intel = intel_context(ctx);
struct brw_context *brw = brw_context(ctx);
__DRIscreen *screen;
__DRIimage *image;
screen = intel->intelScreen->driScrnPriv;
screen = brw->intelScreen->driScrnPriv;
image = screen->dri2.image->lookupEGLImage(screen, image_handle,
screen->loaderPrivate);
if (image == NULL)