diff options
author | Eric Anholt <eric@anholt.net> | 2009-10-06 18:24:50 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2009-10-08 15:34:09 -0700 |
commit | af27a3a0a5645c6f41f583611bd0f2559dc7cb2f (patch) | |
tree | cc59506521f6177723ec16247c76e9ac96a48afe | |
parent | cc5d3ba3c331c3b1becf2d19277b24144bf34cfa (diff) |
Rename the xf86 screen private from pScrn to scrn.
-rw-r--r-- | src/common.h | 2 | ||||
-rw-r--r-- | src/drmmode_display.c | 58 | ||||
-rw-r--r-- | src/i810_driver.c | 2 | ||||
-rw-r--r-- | src/i830.h | 64 | ||||
-rw-r--r-- | src/i830_3d.c | 4 | ||||
-rw-r--r-- | src/i830_accel.c | 20 | ||||
-rw-r--r-- | src/i830_batchbuffer.c | 22 | ||||
-rw-r--r-- | src/i830_batchbuffer.h | 26 | ||||
-rw-r--r-- | src/i830_bios.c | 30 | ||||
-rw-r--r-- | src/i830_bios.h | 2 | ||||
-rw-r--r-- | src/i830_display.h | 10 | ||||
-rw-r--r-- | src/i830_dri.c | 32 | ||||
-rw-r--r-- | src/i830_driver.c | 428 | ||||
-rw-r--r-- | src/i830_hwmc.c | 38 | ||||
-rw-r--r-- | src/i830_memory.c | 128 | ||||
-rw-r--r-- | src/i830_render.c | 48 | ||||
-rw-r--r-- | src/i830_ring.h | 4 | ||||
-rw-r--r-- | src/i830_uxa.c | 42 | ||||
-rw-r--r-- | src/i830_video.c | 172 | ||||
-rw-r--r-- | src/i830_video.h | 8 | ||||
-rw-r--r-- | src/i915_3d.c | 4 | ||||
-rw-r--r-- | src/i915_hwmc.c | 148 | ||||
-rw-r--r-- | src/i915_render.c | 46 | ||||
-rw-r--r-- | src/i915_video.c | 10 | ||||
-rw-r--r-- | src/i965_hwmc.c | 20 | ||||
-rw-r--r-- | src/i965_render.c | 94 | ||||
-rw-r--r-- | src/i965_video.c | 56 |
27 files changed, 759 insertions, 759 deletions
diff --git a/src/common.h b/src/common.h index 505fcb2b..5bc79e5c 100644 --- a/src/common.h +++ b/src/common.h @@ -78,7 +78,7 @@ I830DPRINTF_stub(const char *filename, int line, const char *function, #ifndef REG_DUMPER /* I830 hooks for the I810 driver setup/probe. */ extern const OptionInfoRec *I830AvailableOptions(int chipid, int busid); -extern void I830InitpScrn(ScrnInfoPtr pScrn); +extern void intel_init_scrn(ScrnInfoPtr scrn); /* Symbol lists shared by the i810 and i830 parts. */ extern int I830EntityIndex; diff --git a/src/drmmode_display.c b/src/drmmode_display.c index 7358cad7..ba1e7518 100644 --- a/src/drmmode_display.c +++ b/src/drmmode_display.c @@ -298,8 +298,8 @@ static Bool drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation, int x, int y) { - ScrnInfoPtr pScrn = crtc->scrn; - intel_screen_private *intel = intel_get_screen_private(pScrn); + ScrnInfoPtr scrn = crtc->scrn; + intel_screen_private *intel = intel_get_screen_private(scrn); xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(crtc->scrn); drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; drmmode_ptr drmmode = drmmode_crtc->drmmode; @@ -312,12 +312,12 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode, int i; int fb_id; drmModeModeInfo kmode; - unsigned int pitch = pScrn->displayWidth * intel->cpp; + unsigned int pitch = scrn->displayWidth * intel->cpp; if (drmmode->fb_id == 0) { ret = drmModeAddFB(drmmode->fd, - pScrn->virtualX, pScrn->virtualY, - pScrn->depth, pScrn->bitsPerPixel, + scrn->virtualX, scrn->virtualY, + scrn->depth, scrn->bitsPerPixel, pitch, intel->front_buffer->bo->handle, &drmmode->fb_id); if (ret < 0) { @@ -390,10 +390,10 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode, drmmode_output_dpms(output, DPMSModeOn); } - i830_set_max_gtt_map_size(pScrn); + i830_set_max_gtt_map_size(scrn); - if (pScrn->pScreen) - xf86_reload_cursors(pScrn->pScreen); + if (scrn->pScreen) + xf86_reload_cursors(scrn->pScreen); done: if (!ret) { crtc->x = saved_x; @@ -458,8 +458,8 @@ drmmode_show_cursor (xf86CrtcPtr crtc) static void * drmmode_crtc_shadow_allocate(xf86CrtcPtr crtc, int width, int height) { - ScrnInfoPtr pScrn = crtc->scrn; - intel_screen_private *intel = intel_get_screen_private(pScrn); + ScrnInfoPtr scrn = crtc->scrn; + intel_screen_private *intel = intel_get_screen_private(scrn); drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; drmmode_ptr drmmode = drmmode_crtc->drmmode; int size, ret; @@ -494,7 +494,7 @@ drmmode_crtc_shadow_allocate(xf86CrtcPtr crtc, int width, int height) static PixmapPtr drmmode_crtc_shadow_create(xf86CrtcPtr crtc, void *data, int width, int height) { - ScrnInfoPtr pScrn = crtc->scrn; + ScrnInfoPtr scrn = crtc->scrn; drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; drmmode_ptr drmmode = drmmode_crtc->drmmode; unsigned long rotate_pitch; @@ -503,7 +503,7 @@ drmmode_crtc_shadow_create(xf86CrtcPtr crtc, void *data, int width, int height) if (!data) { data = drmmode_crtc_shadow_allocate (crtc, width, height); if (!data) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + xf86DrvMsg(scrn->scrnIndex, X_ERROR, "Couldn't allocate shadow pixmap for rotated CRTC\n"); return NULL; } @@ -511,15 +511,15 @@ drmmode_crtc_shadow_create(xf86CrtcPtr crtc, void *data, int width, int height) rotate_pitch = i830_pad_drawable_width(width, drmmode->cpp) * drmmode->cpp; - rotate_pixmap = GetScratchPixmapHeader(pScrn->pScreen, + rotate_pixmap = GetScratchPixmapHeader(scrn->pScreen, width, height, - pScrn->depth, - pScrn->bitsPerPixel, + scrn->depth, + scrn->bitsPerPixel, rotate_pitch, NULL); if (rotate_pixmap == NULL) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + xf86DrvMsg(scrn->scrnIndex, X_ERROR, "Couldn't allocate shadow pixmap for rotated CRTC\n"); return NULL; } @@ -580,12 +580,12 @@ static const xf86CrtcFuncsRec drmmode_crtc_funcs = { static void -drmmode_crtc_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int num) +drmmode_crtc_init(ScrnInfoPtr scrn, drmmode_ptr drmmode, int num) { xf86CrtcPtr crtc; drmmode_crtc_private_ptr drmmode_crtc; - crtc = xf86CrtcCreate(pScrn, &drmmode_crtc_funcs); + crtc = xf86CrtcCreate(scrn, &drmmode_crtc_funcs); if (crtc == NULL) return; @@ -1226,7 +1226,7 @@ static const char *output_names[] = { "None", static void -drmmode_output_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int num) +drmmode_output_init(ScrnInfoPtr scrn, drmmode_ptr drmmode, int num) { xf86OutputPtr output; drmModeConnectorPtr koutput; @@ -1248,7 +1248,7 @@ drmmode_output_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int num) snprintf(name, 32, "%s%d", output_names[koutput->connector_type], koutput->connector_type_id); - output = xf86OutputCreate (pScrn, &drmmode_output_funcs, name); + output = xf86OutputCreate (scrn, &drmmode_output_funcs, name); if (!output) { drmModeFreeEncoder(kencoder); drmModeFreeConnector(koutput); @@ -1272,7 +1272,7 @@ drmmode_output_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int num) drmmode_output->private_data = xcalloc( sizeof(struct fixed_panel_lvds), 1); if (!drmmode_output->private_data) - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + xf86DrvMsg(scrn->scrnIndex, X_ERROR, "Can't allocate private memory for LVDS.\n"); } drmmode_output->output_id = drmmode->mode_res->connectors[num]; @@ -1374,7 +1374,7 @@ static const xf86CrtcConfigFuncsRec drmmode_xf86crtc_config_funcs = { drmmode_xf86crtc_resize }; -Bool drmmode_pre_init(ScrnInfoPtr pScrn, int fd, int cpp) +Bool drmmode_pre_init(ScrnInfoPtr scrn, int fd, int cpp) { xf86CrtcConfigPtr xf86_config; drmmode_ptr drmmode; @@ -1384,26 +1384,26 @@ Bool drmmode_pre_init(ScrnInfoPtr pScrn, int fd, int cpp) drmmode->fd = fd; drmmode->fb_id = 0; - xf86CrtcConfigInit(pScrn, &drmmode_xf86crtc_config_funcs); - xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); + xf86CrtcConfigInit(scrn, &drmmode_xf86crtc_config_funcs); + xf86_config = XF86_CRTC_CONFIG_PTR(scrn); drmmode->cpp = cpp; drmmode->mode_res = drmModeGetResources(drmmode->fd); if (!drmmode->mode_res) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + xf86DrvMsg(scrn->scrnIndex, X_ERROR, "failed to get resources: %s\n", strerror(errno)); return FALSE; } - xf86CrtcSetSizeRange(pScrn, 320, 200, drmmode->mode_res->max_width, + xf86CrtcSetSizeRange(scrn, 320, 200, drmmode->mode_res->max_width, drmmode->mode_res->max_height); for (i = 0; i < drmmode->mode_res->count_crtcs; i++) - drmmode_crtc_init(pScrn, drmmode, i); + drmmode_crtc_init(scrn, drmmode, i); for (i = 0; i < drmmode->mode_res->count_connectors; i++) - drmmode_output_init(pScrn, drmmode, i); + drmmode_output_init(scrn, drmmode, i); - xf86InitialConfiguration(pScrn, TRUE); + xf86InitialConfiguration(scrn, TRUE); return TRUE; } diff --git a/src/i810_driver.c b/src/i810_driver.c index bb3bad80..68e45bb6 100644 --- a/src/i810_driver.c +++ b/src/i810_driver.c @@ -476,7 +476,7 @@ static Bool intel_pci_probe (DriverPtr driver, break; #endif default: - I830InitpScrn(scrn); + intel_init_scrn(scrn); break; } } @@ -74,7 +74,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Bool i830_uxa_init(ScreenPtr pScreen); void i830_uxa_create_screen_resources(ScreenPtr pScreen); void i830_uxa_block_handler(ScreenPtr pScreen); -Bool i830_get_aperture_space(ScrnInfoPtr pScrn, drm_intel_bo ** bo_table, +Bool i830_get_aperture_space(ScrnInfoPtr scrn, drm_intel_bo ** bo_table, int num_bos); dri_bo *i830_get_pixmap_bo(PixmapPtr pixmap); @@ -226,7 +226,7 @@ typedef struct intel_screen_private { CloseScreenProcPtr CloseScreen; - void (*batch_flush_notify) (ScrnInfoPtr pScrn); + void (*batch_flush_notify) (ScrnInfoPtr scrn); uxa_driver_t *uxa_driver; Bool need_flush; @@ -321,23 +321,23 @@ unsigned long intel_get_pixmap_pitch(PixmapPtr pPix); #include "i830_batchbuffer.h" /* I830 specific functions */ -extern void I830Sync(ScrnInfoPtr pScrn); -extern void IntelEmitInvarientState(ScrnInfoPtr pScrn); -extern void I830EmitInvarientState(ScrnInfoPtr pScrn); -extern void I915EmitInvarientState(ScrnInfoPtr pScrn); +extern void I830Sync(ScrnInfoPtr scrn); +extern void IntelEmitInvarientState(ScrnInfoPtr scrn); +extern void I830EmitInvarientState(ScrnInfoPtr scrn); +extern void I915EmitInvarientState(ScrnInfoPtr scrn); -extern void I830EmitFlush(ScrnInfoPtr pScrn); +extern void I830EmitFlush(ScrnInfoPtr scrn); extern void I830InitVideo(ScreenPtr pScreen); -extern xf86CrtcPtr i830_covering_crtc(ScrnInfoPtr pScrn, BoxPtr box, +extern xf86CrtcPtr i830_covering_crtc(ScrnInfoPtr scrn, BoxPtr box, xf86CrtcPtr desired, BoxPtr crtc_box_ret); -extern xf86CrtcPtr i830_pipe_to_crtc(ScrnInfoPtr pScrn, int pipe); +extern xf86CrtcPtr i830_pipe_to_crtc(ScrnInfoPtr scrn, int pipe); Bool I830DRI2ScreenInit(ScreenPtr pScreen); void I830DRI2CloseScreen(ScreenPtr pScreen); -extern Bool drmmode_pre_init(ScrnInfoPtr pScrn, int fd, int cpp); +extern Bool drmmode_pre_init(ScrnInfoPtr scrn, int fd, int cpp); extern int drmmode_get_pipe_from_crtc_id(drm_intel_bufmgr * bufmgr, xf86CrtcPtr crtc); extern int drmmode_output_dpms_status(xf86OutputPtr output); @@ -348,25 +348,25 @@ extern Bool i830_crtc_on(xf86CrtcPtr crtc); extern int i830_crtc_to_pipe(xf86CrtcPtr crtc); extern Bool I830AccelInit(ScreenPtr pScreen); -Bool i830_allocator_init(ScrnInfoPtr pScrn, unsigned long size); -void i830_allocator_fini(ScrnInfoPtr pScrn); -i830_memory *i830_allocate_memory(ScrnInfoPtr pScrn, const char *name, +Bool i830_allocator_init(ScrnInfoPtr scrn, unsigned long size); +void i830_allocator_fini(ScrnInfoPtr scrn); +i830_memory *i830_allocate_memory(ScrnInfoPtr scrn, const char *name, unsigned long size, unsigned long pitch, unsigned long alignment, int flags, enum tile_format tile_format); -void i830_describe_allocations(ScrnInfoPtr pScrn, int verbosity, +void i830_describe_allocations(ScrnInfoPtr scrn, int verbosity, const char *prefix); -void i830_reset_allocations(ScrnInfoPtr pScrn); -void i830_free_3d_memory(ScrnInfoPtr pScrn); -void i830_free_memory(ScrnInfoPtr pScrn, i830_memory * mem); -Bool i830_allocate_2d_memory(ScrnInfoPtr pScrn); -Bool i830_allocate_3d_memory(ScrnInfoPtr pScrn); -void i830_init_bufmgr(ScrnInfoPtr pScrn); +void i830_reset_allocations(ScrnInfoPtr scrn); +void i830_free_3d_memory(ScrnInfoPtr scrn); +void i830_free_memory(ScrnInfoPtr scrn, i830_memory * mem); +Bool i830_allocate_2d_memory(ScrnInfoPtr scrn); +Bool i830_allocate_3d_memory(ScrnInfoPtr scrn); +void i830_init_bufmgr(ScrnInfoPtr scrn); #ifdef INTEL_XVMC -Bool i830_allocate_xvmc_buffer(ScrnInfoPtr pScrn, const char *name, +Bool i830_allocate_xvmc_buffer(ScrnInfoPtr scrn, const char *name, i830_memory ** buffer, unsigned long size, int flags); -void i830_free_xvmc_buffer(ScrnInfoPtr pScrn, i830_memory * buffer); +void i830_free_xvmc_buffer(ScrnInfoPtr scrn, i830_memory * buffer); #endif Bool i830_tiled_width(intel_screen_private *intel, int *width, int cpp); @@ -374,13 +374,13 @@ Bool i830_tiled_width(intel_screen_private *intel, int *width, int cpp); int i830_pad_drawable_width(int width, int cpp); /* i830_memory.c */ -Bool i830_bind_all_memory(ScrnInfoPtr pScrn); +Bool i830_bind_all_memory(ScrnInfoPtr scrn); unsigned long i830_get_fence_size(intel_screen_private *intel, unsigned long size); unsigned long i830_get_fence_pitch(intel_screen_private *intel, unsigned long pitch, int format); -void i830_set_max_gtt_map_size(ScrnInfoPtr pScrn); +void i830_set_max_gtt_map_size(ScrnInfoPtr scrn); -i830_memory *i830_allocate_framebuffer(ScrnInfoPtr pScrn); +i830_memory *i830_allocate_framebuffer(ScrnInfoPtr scrn); /* i830_render.c */ Bool i830_check_composite(int op, PicturePtr pSrc, PicturePtr pMask, @@ -401,12 +401,12 @@ Bool i915_prepare_composite(int op, PicturePtr pSrc, PicturePtr pMask, PixmapPtr pMaskPixmap, PixmapPtr pDstPixmap); void i915_composite(PixmapPtr pDst, int srcX, int srcY, int maskX, int maskY, int dstX, int dstY, int w, int h); -void i915_batch_flush_notify(ScrnInfoPtr pScrn); +void i915_batch_flush_notify(ScrnInfoPtr scrn); void i830_batch_flush_notify(ScrnInfoPtr scrn); /* i965_render.c */ -unsigned int gen4_render_state_size(ScrnInfoPtr pScrn); -void gen4_render_state_init(ScrnInfoPtr pScrn); -void gen4_render_state_cleanup(ScrnInfoPtr pScrn); +unsigned int gen4_render_state_size(ScrnInfoPtr scrn); +void gen4_render_state_init(ScrnInfoPtr scrn); +void gen4_render_state_cleanup(ScrnInfoPtr scrn); Bool i965_check_composite(int op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst); Bool i965_prepare_composite(int op, PicturePtr pSrc, PicturePtr pMask, @@ -415,7 +415,7 @@ Bool i965_prepare_composite(int op, PicturePtr pSrc, PicturePtr pMask, void i965_composite(PixmapPtr pDst, int srcX, int srcY, int maskX, int maskY, int dstX, int dstY, int w, int h); -void i965_batch_flush_notify(ScrnInfoPtr pScrn); +void i965_batch_flush_notify(ScrnInfoPtr scrn); Bool i830_get_transformed_coordinates(int x, int y, PictTransformPtr transform, @@ -429,8 +429,8 @@ void i830_enter_render(ScrnInfoPtr); #define I830FALLBACK(s, arg...) \ do { \ - if (intel_get_screen_private(pScrn)->fallback_debug) { \ - xf86DrvMsg(pScrn->scrnIndex, X_INFO, \ + if (intel_get_screen_private(scrn)->fallback_debug) { \ + xf86DrvMsg(scrn->scrnIndex, X_INFO, \ "fallback: " s "\n", ##arg); \ } \ return FALSE; \ diff --git a/src/i830_3d.c b/src/i830_3d.c index 28527dcc..c95a0b13 100644 --- a/src/i830_3d.c +++ b/src/i830_3d.c @@ -34,9 +34,9 @@ #include "i830_reg.h" -void I830EmitInvarientState(ScrnInfoPtr pScrn) +void I830EmitInvarientState(ScrnInfoPtr scrn) { - intel_screen_private *intel = intel_get_screen_private(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); BEGIN_BATCH(58); diff --git a/src/i830_accel.c b/src/i830_accel.c index f9cbda8f..1a7c61fa 100644 --- a/src/i830_accel.c +++ b/src/i830_accel.c @@ -53,25 +53,25 @@ unsigned long intel_get_pixmap_pitch(PixmapPtr pPix) return (unsigned long)pPix->devKind; } -void I830Sync(ScrnInfoPtr pScrn) +void I830Sync(ScrnInfoPtr scrn) { - intel_screen_private *intel = intel_get_screen_private(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); if (I810_DEBUG & (DEBUG_VERBOSE_ACCEL | DEBUG_VERBOSE_SYNC)) ErrorF("I830Sync\n"); - if (!pScrn->vtSema || !intel->batch_bo) + if (!scrn->vtSema || !intel->batch_bo) return; - I830EmitFlush(pScrn); + I830EmitFlush(scrn); - intel_batch_flush(pScrn, TRUE); - intel_batch_wait_last(pScrn); + intel_batch_flush(scrn, TRUE); + intel_batch_wait_last(scrn); } -void I830EmitFlush(ScrnInfoPtr pScrn) +void I830EmitFlush(ScrnInfoPtr scrn) { - intel_screen_private *intel = intel_get_screen_private(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); int flags = MI_WRITE_DIRTY_STATE | MI_INVALIDATE_MAP_CACHE; if (IS_I965G(intel)) @@ -100,8 +100,8 @@ void i830_debug_sync(ScrnInfoPtr scrn) */ Bool I830AccelInit(ScreenPtr pScreen) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; - intel_screen_private *intel = intel_get_screen_private(pScrn); + ScrnInfoPtr scrn = xf86Screens[pScreen->myNum]; + intel_screen_private *intel = intel_get_screen_private(scrn); /* Limits are described in the BLT engine chapter under Graphics Data Size * Limitations, and the descriptions of SURFACE_STATE, 3DSTATE_BUFFER_INFO, diff --git a/src/i830_batchbuffer.c b/src/i830_batchbuffer.c index 553eeb3b..f662dfcd 100644 --- a/src/i830_batchbuffer.c +++ b/src/i830_batchbuffer.c @@ -39,9 +39,9 @@ #include "i830_ring.h" #include "i915_drm.h" -static void intel_next_batch(ScrnInfoPtr pScrn) +static void intel_next_batch(ScrnInfoPtr scrn) { - intel_screen_private *intel = intel_get_screen_private(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); /* The 865 has issues with larger-than-page-sized batch buffers. */ if (IS_I865G(intel)) @@ -64,19 +64,19 @@ static void intel_next_batch(ScrnInfoPtr pScrn) intel->last_3d = LAST_3D_OTHER; } -void intel_batch_init(ScrnInfoPtr pScrn) +void intel_batch_init(ScrnInfoPtr scrn) { - intel_screen_private *intel = intel_get_screen_private(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); intel->batch_emit_start = 0; intel->batch_emitting = 0; - intel_next_batch(pScrn); + intel_next_batch(scrn); } -void intel_batch_teardown(ScrnInfoPtr pScrn) +void intel_batch_teardown(ScrnInfoPtr scrn) { - intel_screen_private *intel = intel_get_screen_private(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); if (intel->batch_ptr != NULL) { dri_bo_unmap(intel->batch_bo); @@ -90,9 +90,9 @@ void intel_batch_teardown(ScrnInfoPtr pScrn) } } -void intel_batch_flush(ScrnInfoPtr pScrn, Bool flushed) +void intel_batch_flush(ScrnInfoPtr scrn, Bool flushed) { - intel_screen_private *intel = intel_get_screen_private(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); int ret; if (intel->batch_used == 0) @@ -126,7 +126,7 @@ void intel_batch_flush(ScrnInfoPtr pScrn, Bool flushed) intel->last_batch_bo = intel->batch_bo; intel->batch_bo = NULL; - intel_next_batch(pScrn); + intel_next_batch(scrn); /* Mark that we need to flush whatever potential rendering we've done in the * blockhandler. We could set this less often, but it's probably not worth @@ -135,7 +135,7 @@ void intel_batch_flush(ScrnInfoPtr pScrn, Bool flushed) intel->need_mi_flush = TRUE; if (intel->batch_flush_notify) - intel->batch_flush_notify(pScrn); + intel->batch_flush_notify(scrn); } /** Waits on the last emitted batchbuffer to be completed. */ diff --git a/src/i830_batchbuffer.h b/src/i830_batchbuffer.h index cd8e0265..f351a1af 100644 --- a/src/i830_batchbuffer.h +++ b/src/i830_batchbuffer.h @@ -32,10 +32,10 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define BATCH_RESERVED 16 -void intel_batch_init(ScrnInfoPtr pScrn); -void intel_batch_teardown(ScrnInfoPtr pScrn); -void intel_batch_flush(ScrnInfoPtr pScrn, Bool flushed); -void intel_batch_wait_last(ScrnInfoPtr pScrn); +void intel_batch_init(ScrnInfoPtr scrn); +void intel_batch_teardown(ScrnInfoPtr scrn); +void intel_batch_flush(ScrnInfoPtr scrn, Bool flushed); +void intel_batch_wait_last(ScrnInfoPtr scrn); static inline int intel_batch_space(intel_screen_private *intel) { @@ -43,27 +43,27 @@ static inline int intel_batch_space(intel_screen_private *intel) } static inline void -intel_batch_require_space(ScrnInfoPtr pScrn, intel_screen_private *intel, GLuint sz) +intel_batch_require_space(ScrnInfoPtr scrn, intel_screen_private *intel, GLuint sz) { assert(sz < intel->batch_bo->size - 8); if (intel_batch_space(intel) < sz) - intel_batch_flush(pScrn, FALSE); + intel_batch_flush(scrn, FALSE); } -static inline void intel_batch_start_atomic(ScrnInfoPtr pScrn, unsigned int sz) +static inline void intel_batch_start_atomic(ScrnInfoPtr scrn, unsigned int sz) { - intel_screen_private *intel = intel_get_screen_private(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); assert(!intel->in_batch_atomic); - intel_batch_require_space(pScrn, intel, sz * 4); + intel_batch_require_space(scrn, intel, sz * 4); intel->in_batch_atomic = TRUE; intel->batch_atomic_limit = intel->batch_used + sz * 4; } -static inline void intel_batch_end_atomic(ScrnInfoPtr pScrn) +static inline void intel_batch_end_atomic(ScrnInfoPtr scrn) { - intel_screen_private *intel = intel_get_screen_private(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); assert(intel->in_batch_atomic); assert(intel->batch_used <= intel->batch_atomic_limit); @@ -127,7 +127,7 @@ do { \ if (intel->batch_emitting != 0) \ FatalError("%s: BEGIN_BATCH called without closing " \ "ADVANCE_BATCH\n", __FUNCTION__); \ - intel_batch_require_space(pScrn, intel, (n) * 4); \ + intel_batch_require_space(scrn, intel, (n) * 4); \ intel->batch_emitting = (n) * 4; \ intel->batch_emit_start = intel->batch_used; \ } while (0) @@ -151,7 +151,7 @@ do { \ if ((intel->batch_emitting > 8) && \ (I810_DEBUG & DEBUG_ALWAYS_SYNC)) { \ /* Note: not actually syncing, just flushing each batch. */ \ - intel_batch_flush(pScrn, FALSE); \ + intel_batch_flush(scrn, FALSE); \ } \ intel->batch_emitting = 0; \ } while (0) diff --git a/src/i830_bios.c b/src/i830_bios.c index f1f1644a..dd73b571 100644 --- a/src/i830_bios.c +++ b/src/i830_bios.c @@ -242,7 +242,7 @@ static void parse_driver_feature(intel_screen_private *intel, struct bdb_header } static -void parse_sdvo_mapping(ScrnInfoPtr pScrn, struct bdb_header *bdb) +void parse_sdvo_mapping(ScrnInfoPtr scrn, struct bdb_header *bdb) { unsigned int block_size; uint16_t *block_ptr; @@ -250,11 +250,11 @@ void parse_sdvo_mapping(ScrnInfoPtr pScrn, struct bdb_header *bdb) struct child_device_config *child; int i, child_device_num, count; struct sdvo_device_mapping *p_mapping; - intel_screen_private *intel = intel_get_screen_private(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); defs = find_section(bdb, BDB_GENERAL_DEFINITIONS); if (!defs) { - xf86DrvMsg(pScrn->scrnIndex, X_WARNING, + xf86DrvMsg(scrn->scrnIndex, X_WARNING, "can't find the general definition blocks\n"); return; } @@ -275,11 +275,11 @@ void parse_sdvo_mapping(ScrnInfoPtr pScrn, struct bdb_header *bdb) if (child->dvo_port != DEVICE_PORT_DVOB && child->dvo_port != DEVICE_PORT_DVOC) { /* skip the incorrect sdvo port */ - xf86DrvMsg(pScrn->scrnIndex, X_WARNING, + xf86DrvMsg(scrn->scrnIndex, X_WARNING, "Incorrect SDVO port\n"); continue; } - xf86DrvMsg(pScrn->scrnIndex, X_INFO, + xf86DrvMsg(scrn->scrnIndex, X_INFO, "the SDVO device with slave addr %x " "is found on DVO %x port\n", child->slave_addr, child->dvo_port); @@ -292,7 +292,7 @@ void parse_sdvo_mapping(ScrnInfoPtr pScrn, struct bdb_header *bdb) p_mapping->initialized = 1; p_mapping->slave_addr = child->slave_addr; } else { - xf86DrvMsg(pScrn->scrnIndex, X_WARNING, + xf86DrvMsg(scrn->scrnIndex, X_WARNING, "One DVO port is shared by two slave " "address. Maybe it can't be handled\n"); } @@ -303,7 +303,7 @@ void parse_sdvo_mapping(ScrnInfoPtr pScrn, struct bdb_header *bdb) * of course its mapping info won't be added. */ if (child->slave2_addr) { - xf86DrvMsg(pScrn->scrnIndex, X_WARNING, + xf86DrvMsg(scrn->scrnIndex, X_WARNING, "Two DVO ports uses the same slave address." "Maybe it can't be handled by SDVO driver\n"); } @@ -315,7 +315,7 @@ void parse_sdvo_mapping(ScrnInfoPtr pScrn, struct bdb_header *bdb) } /* If the count is zero, it indicates that no sdvo device is found */ if (!count) - xf86DrvMsg(pScrn->scrnIndex, X_INFO, + xf86DrvMsg(scrn->scrnIndex, X_INFO, "No SDVO device is found in VBT\n"); return; @@ -333,9 +333,9 @@ void parse_sdvo_mapping(ScrnInfoPtr pScrn, struct bdb_header *bdb) * * Returns 0 on success, nonzero on failure. */ -int i830_bios_init(ScrnInfoPtr pScrn) +int i830_bios_init(ScrnInfoPtr scrn) { - intel_screen_private *intel = intel_get_screen_private(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); struct vbt_header *vbt; struct bdb_header *bdb; int vbt_off, bdb_off; @@ -346,7 +346,7 @@ int i830_bios_init(ScrnInfoPtr pScrn) size = intel->PciInfo->rom_size; if (size == 0) { size = INTEL_VBIOS_SIZE; - xf86DrvMsg(pScrn->scrnIndex, X_WARNING, + xf86DrvMsg(scrn->scrnIndex, X_WARNING, "libpciaccess reported 0 rom size, guessing %dkB\n", size / 1024); } @@ -356,7 +356,7 @@ int i830_bios_init(ScrnInfoPtr pScrn) ret = pci_device_read_rom(intel->PciInfo, bios); if (ret != 0) { - xf86DrvMsg(pScrn->scrnIndex, X_WARNING, + xf86DrvMsg(scrn->scrnIndex, X_WARNING, "libpciaccess failed to read %dkB video BIOS: %s\n", size / 1024, strerror(-ret)); xfree(bios); @@ -365,7 +365,7 @@ int i830_bios_init(ScrnInfoPtr pScrn) vbt_off = INTEL_BIOS_16(0x1a); if (vbt_off >= size) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Bad VBT offset: 0x%x\n", + xf86DrvMsg(scrn->scrnIndex, X_ERROR, "Bad VBT offset: 0x%x\n", vbt_off); xfree(bios); return -1; @@ -374,7 +374,7 @@ int i830_bios_init(ScrnInfoPtr pScrn) vbt = (struct vbt_header *)(bios + vbt_off); if (memcmp(vbt->signature, "$VBT", 4) != 0) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Bad VBT signature\n"); + xf86DrvMsg(scrn->scrnIndex, X_ERROR, "Bad VBT signature\n"); xfree(bios); return -1; } @@ -386,7 +386,7 @@ int i830_bios_init(ScrnInfoPtr pScrn) parse_general_features(intel, bdb); parse_panel_data(intel, bdb); parse_driver_feature(intel, bdb); - parse_sdvo_mapping(pScrn, bdb); + parse_sdvo_mapping(scrn, bdb); xfree(bios); diff --git a/src/i830_bios.h b/src/i830_bios.h index f43911e5..436426d5 100644 --- a/src/i830_bios.h +++ b/src/i830_bios.h @@ -491,7 +491,7 @@ struct bdb_sdvo_lvds_options { } __attribute__ ((packed)); #ifndef REG_DUMPER -int i830_bios_init(ScrnInfoPtr pScrn); +int i830_bios_init(ScrnInfoPtr scrn); #endif /* diff --git a/src/i830_display.h b/src/i830_display.h index d9b56e9c..d8961f09 100644 --- a/src/i830_display.h +++ b/src/i830_display.h @@ -29,14 +29,14 @@ /* i830_display.c */ void i830PipeSetBase(xf86CrtcPtr crtc, int x, int y); -void i830WaitForVblank(ScrnInfoPtr pScrn); -void i830DescribeOutputConfiguration(ScrnInfoPtr pScrn); -void i830_set_new_crtc_bo(ScrnInfoPtr pScrn); +void i830WaitForVblank(ScrnInfoPtr scrn); +void i830DescribeOutputConfiguration(ScrnInfoPtr scrn); +void i830_set_new_crtc_bo(ScrnInfoPtr scrn); xf86CrtcPtr i830GetLoadDetectPipe(xf86OutputPtr output, DisplayModePtr mode, int *dpms_mode); void i830ReleaseLoadDetectPipe(xf86OutputPtr output, int dpms_mode); -void i830_crtc_init(ScrnInfoPtr pScrn, int pipe); -DisplayModePtr i830_crtc_mode_get(ScrnInfoPtr pScrn, xf86CrtcPtr crtc); +void i830_crtc_init(ScrnInfoPtr scrn, int pipe); +DisplayModePtr i830_crtc_mode_get(ScrnInfoPtr scrn, xf86CrtcPtr crtc); void i830_output_prepare(xf86OutputPtr output); void i830_output_commit(xf86OutputPtr output); diff --git a/src/i830_dri.c b/src/i830_dri.c index fe738b83..9e51b8c5 100644 --- a/src/i830_dri.c +++ b/src/i830_dri.c @@ -83,8 +83,8 @@ static DRI2BufferPtr I830DRI2CreateBuffers(DrawablePtr pDraw, unsigned int *attachments, int count) { ScreenPtr pScreen = pDraw->pScreen; - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; - intel_screen_private *intel = intel_get_screen_private(pScrn); + ScrnInfoPtr scrn = xf86Screens[pScreen->myNum]; + intel_screen_private *intel = intel_get_screen_private(scrn); DRI2BufferPtr buffers; dri_bo *bo; int i; @@ -164,8 +164,8 @@ I830DRI2CreateBuffer(DrawablePtr pDraw, unsigned int attachment, unsigned int format) { ScreenPtr pScreen = pDraw->pScreen; - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; - intel_screen_private *intel = intel_get_screen_private(pScrn); + ScrnInfoPtr scrn = xf86Screens[pScreen->myNum]; + intel_screen_private *intel = intel_get_screen_private(scrn); DRI2Buffer2Ptr buffer; dri_bo *bo; I830DRI2BufferPrivatePtr privates; @@ -277,8 +277,8 @@ I830DRI2CopyRegion(DrawablePtr pDraw, RegionPtr pRegion, I830DRI2BufferPrivatePtr srcPrivate = pSrcBuffer->driverPrivate; I830DRI2BufferPrivatePtr dstPrivate = pDstBuffer->driverPrivate; ScreenPtr pScreen = pDraw->pScreen; - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; - intel_screen_private *intel = intel_get_screen_private(pScrn); + ScrnInfoPtr scrn = xf86Screens[pScreen->myNum]; + intel_screen_private *intel = intel_get_screen_private(scrn); DrawablePtr src = (srcPrivate->attachment == DRI2BufferFrontLeft) ? pDraw : &srcPrivate->pPixmap->drawable; DrawablePtr dst = (dstPrivate->attachment == DRI2BufferFrontLeft) @@ -302,7 +302,7 @@ I830DRI2CopyRegion(DrawablePtr pDraw, RegionPtr pRegion, xf86CrtcPtr crtc; box = REGION_EXTENTS(unused, pGC->pCompositeClip); - crtc = i830_covering_crtc(pScrn, box, NULL, &crtcbox); + crtc = i830_covering_crtc(scrn, box, NULL, &crtcbox); /* Make sure the CRTC is valid and this is the real front buffer */ if (crtc != NULL && !crtc->rotatedData) { @@ -345,14 +345,14 @@ I830DRI2CopyRegion(DrawablePtr pDraw, RegionPtr pRegion, * rendering results may not hit the framebuffer until significantly * later. */ - I830EmitFlush(pScrn); + I830EmitFlush(scrn); intel->need_mi_flush = FALSE; /* We can't rely on getting into the block handler before the DRI * client gets to run again so flush now. */ - intel_batch_flush(pScrn, TRUE); + intel_batch_flush(scrn, TRUE); #if ALWAYS_SYNC - I830Sync(pScrn); + I830Sync(scrn); #endif drmCommandNone(intel->drmSubFD, DRM_I915_GEM_THROTTLE); @@ -360,8 +360,8 @@ I830DRI2CopyRegion(DrawablePtr pDraw, RegionPtr pRegion, Bool I830DRI2ScreenInit(ScreenPtr pScreen) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; - intel_screen_private *intel = intel_get_screen_private(pScrn); + ScrnInfoPtr scrn = xf86Screens[pScreen->myNum]; + intel_screen_private *intel = intel_get_screen_private(scrn); DRI2InfoRec info; char *p; int i; @@ -378,7 +378,7 @@ Bool I830DRI2ScreenInit(ScreenPtr pScreen) } if (dri2_minor < 1) { - xf86DrvMsg(pScrn->scrnIndex, X_WARNING, + xf86DrvMsg(scrn->scrnIndex, X_WARNING, "DRI2 requires DRI2 module version 1.1.0 or later\n"); return FALSE; } @@ -401,7 +401,7 @@ Bool I830DRI2ScreenInit(ScreenPtr pScreen) break; } if (i == DRM_MAX_MINOR) { - xf86DrvMsg(pScrn->scrnIndex, X_WARNING, + xf86DrvMsg(scrn->scrnIndex, X_WARNING, "DRI2: failed to open drm device\n"); return FALSE; } @@ -434,8 +434,8 @@ Bool I830DRI2ScreenInit(ScreenPtr pScreen) void I830DRI2CloseScreen(ScreenPtr pScreen) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; - intel_screen_private *intel = intel_get_screen_private(pScrn); + ScrnInfoPtr scrn = xf86Screens[pScreen->myNum]; + intel_screen_private *intel = intel_get_screen_private(scrn); DRI2CloseScreen(pScreen); intel->directRenderingType = DRI_NONE; diff --git a/src/i830_driver.c b/src/i830_driver.c index dbf6c11e..898a0f05 100644 --- a/src/i830_driver.c +++ b/src/i830_driver.c @@ -224,36 +224,36 @@ const OptionInfoRec *I830AvailableOptions(int chipid, int busid) return NULL; } -static Bool I830GetRec(ScrnInfoPtr pScrn) +static Bool I830GetRec(ScrnInfoPtr scrn) { intel_screen_private *intel; - if (pScrn->driverPrivate) + if (scrn->driverPrivate) return TRUE; - intel = pScrn->driverPrivate = xnfcalloc(sizeof(intel_screen_private), 1); + intel = scrn->driverPrivate = xnfcalloc(sizeof(intel_screen_private), 1); return TRUE; } -static void I830FreeRec(ScrnInfoPtr pScrn) +static void I830FreeRec(ScrnInfoPtr scrn) { intel_screen_private *intel; - if (!pScrn) + if (!scrn) return; - if (!pScrn->driverPrivate) + if (!scrn->driverPrivate) return; - intel = intel_get_screen_private(pScrn); + intel = intel_get_screen_private(scrn); - xfree(pScrn->driverPrivate); - pScrn->driverPrivate = NULL; + xfree(scrn->driverPrivate); + scrn->driverPrivate = NULL; } static void -I830LoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices, +I830LoadPalette(ScrnInfoPtr scrn, int numColors, int *indices, LOCO * colors, VisualPtr pVisual) { - xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); int i, j, index; int p; uint16_t lut_r[256], lut_g[256], lut_b[256]; @@ -271,7 +271,7 @@ I830LoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices, lut_b[i] = intel_crtc->lut_b[i] << 8; } - switch (pScrn->depth) { + switch (scrn->depth) { case 15: for (i = 0; i < numColors; i++) { index = indices[i]; @@ -331,8 +331,8 @@ I830LoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices, */ static Bool i830CreateScreenResources(ScreenPtr pScreen) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; - intel_screen_private *intel = intel_get_screen_private(pScrn); + ScrnInfoPtr scrn = xf86Screens[pScreen->myNum]; + intel_screen_private *intel = intel_get_screen_private(scrn); pScreen->CreateScreenResources = intel->CreateScreenResources; if (!(*pScreen->CreateScreenResources) (pScreen)) @@ -343,9 +343,9 @@ static Bool i830CreateScreenResources(ScreenPtr pScreen) return TRUE; } -static void PreInitCleanup(ScrnInfoPtr pScrn) +static void PreInitCleanup(ScrnInfoPtr scrn) { - I830FreeRec(pScrn); + I830FreeRec(scrn); } /* @@ -466,14 +466,14 @@ static const xf86CrtcConfigFuncsRec i830_xf86crtc_config_funcs = { * DRM mode setting Linux only at this point... later on we could * add a wrapper here. */ -static Bool i830_kernel_mode_enabled(ScrnInfoPtr pScrn) +static Bool i830_kernel_mode_enabled(ScrnInfoPtr scrn) { struct pci_device *PciInfo; EntityInfoPtr pEnt; char *busIdString; int ret; - pEnt = xf86GetEntityInfo(pScrn->entityList[0]); + pEnt = xf86GetEntityInfo(scrn->entityList[0]); PciInfo = xf86GetPciInfoForEntity(pEnt->index); if (!xf86LoaderCheckSymbol("DRICreatePCIBusID")) @@ -496,9 +496,9 @@ static Bool i830_kernel_mode_enabled(ScrnInfoPtr pScrn) return TRUE; } -static void i830_detect_chipset(ScrnInfoPtr pScrn) +static void i830_detect_chipset(ScrnInfoPtr scrn) { - intel_screen_private *intel = intel_get_screen_private(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); MessageType from = X_PROBED; const char *chipname; uint32_t capid; @@ -529,7 +529,7 @@ static void i830_detect_chipset(ScrnInfoPtr pScrn) chipname = "852GME"; break; default: - xf86DrvMsg(pScrn->scrnIndex, X_INFO, + xf86DrvMsg(scrn->scrnIndex, X_INFO, "Unknown 852GM/855GM variant: 0x%x)\n", intel->variant); chipname = "852GM/855GM (unknown variant)"; @@ -618,48 +618,48 @@ static void i830_detect_chipset(ScrnInfoPtr pScrn) chipname = "unknown chipset"; break; } - xf86DrvMsg(pScrn->scrnIndex, X_INFO, + xf86DrvMsg(scrn->scrnIndex, X_INFO, "Integrated Graphics Chipset: Intel(R) %s\n", chipname); /* Set the Chipset and ChipRev, allowing config file entries to override. */ if (intel->pEnt->device->chipset && *intel->pEnt->device->chipset) { - pScrn->chipset = intel->pEnt->device->chipset; + scrn->chipset = intel->pEnt->device->chipset; from = X_CONFIG; } else if (intel->pEnt->device->chipID >= 0) { - pScrn->chipset = (char *)xf86TokenToString(I830Chipsets, + scrn->chipset = (char *)xf86TokenToString(I830Chipsets, intel->pEnt->device-> chipID); from = X_CONFIG; - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, + xf86DrvMsg(scrn->scrnIndex, X_CONFIG, "ChipID override: 0x%04X\n", intel->pEnt->device->chipID); DEVICE_ID(intel->PciInfo) = intel->pEnt->device->chipID; } else { from = X_PROBED; - pScrn->chipset = (char *)xf86TokenToString(I830Chipsets, + scrn->chipset = (char *)xf86TokenToString(I830Chipsets, DEVICE_ID(intel-> PciInfo)); } if (intel->pEnt->device->chipRev >= 0) { - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "ChipRev override: %d\n", + xf86DrvMsg(scrn->scrnIndex, X_CONFIG, "ChipRev override: %d\n", intel->pEnt->device->chipRev); } - xf86DrvMsg(pScrn->scrnIndex, from, "Chipset: \"%s\"\n", - (pScrn->chipset != NULL) ? pScrn->chipset : "Unknown i8xx"); + xf86DrvMsg(scrn->scrnIndex, from, "Chipset: \"%s\"\n", + (scrn->chipset != NULL) ? scrn->chipset : "Unknown i8xx"); } -static Bool I830GetEarlyOptions(ScrnInfoPtr pScrn) +static Bool I830GetEarlyOptions(ScrnInfoPtr scrn) { - intel_screen_private *intel = intel_get_screen_private(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); /* Process the options */ - xf86CollectOptions(pScrn, NULL); + xf86CollectOptions(scrn, NULL); if (!(intel->Options = xalloc(sizeof(I830Options)))) return FALSE; memcpy(intel->Options, I830Options, sizeof(I830Options)); - xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, intel->Options); + xf86ProcessOptions(scrn->scrnIndex, scrn->options, intel->Options); intel->fallback_debug = xf86ReturnOptValBool(intel->Options, OPTION_FALLBACKDEBUG, @@ -668,15 +668,15 @@ static Bool I830GetEarlyOptions(ScrnInfoPtr pScrn) return TRUE; } -static void i830_check_dri_option(ScrnInfoPtr pScrn) +static void i830_check_dri_option(ScrnInfoPtr scrn) { - intel_screen_private *intel = intel_get_screen_private(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); intel->directRenderingType = DRI_NONE; if (!xf86ReturnOptValBool(intel->Options, OPTION_DRI, TRUE)) intel->directRenderingType = DRI_DISABLED; - if (pScrn->depth != 16 && pScrn->depth != 24) { - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, + if (scrn->depth != 16 && scrn->depth != 24) { + xf86DrvMsg(scrn->scrnIndex, X_CONFIG, "DRI is disabled because it " "runs only at depths 16 and 24.\n"); intel->directRenderingType = DRI_DISABLED; @@ -749,25 +749,25 @@ static void i830_close_drm_master(ScrnInfoPtr scrn) } } -static Bool I830DrmModeInit(ScrnInfoPtr pScrn) +static Bool I830DrmModeInit(ScrnInfoPtr scrn) { - intel_screen_private *intel = intel_get_screen_private(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); - if (drmmode_pre_init(pScrn, intel->drmSubFD, intel->cpp) == FALSE) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + if (drmmode_pre_init(scrn, intel->drmSubFD, intel->cpp) == FALSE) { + xf86DrvMsg(scrn->scrnIndex, X_ERROR, "Kernel modesetting setup failed\n"); - PreInitCleanup(pScrn); + PreInitCleanup(scrn); return FALSE; } - i830_init_bufmgr(pScrn); + i830_init_bufmgr(scrn); return TRUE; } -static void I830XvInit(ScrnInfoPtr pScrn) +static void I830XvInit(ScrnInfoPtr scrn) { - intel_screen_private *intel = intel_get_screen_private(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); MessageType from = X_PROBED; intel->XvPreferOverlay = @@ -781,12 +781,12 @@ static void I830XvInit(ScrnInfoPtr pScrn) from = X_CONFIG; } else { intel->colorKey = - (1 << pScrn->offset.red) | (1 << pScrn->offset.green) | - (((pScrn->mask.blue >> pScrn->offset.blue) - 1) << - pScrn->offset.blue); + (1 << scrn->offset.red) | (1 << scrn->offset.green) | + (((scrn->mask.blue >> scrn->offset.blue) - 1) << + scrn->offset.blue); from = X_DEFAULT; } - xf86DrvMsg(pScrn->scrnIndex, from, "video overlay key set to 0x%x\n", + xf86DrvMsg(scrn->scrnIndex, from, "video overlay key set to 0x%x\n", intel->colorKey); } @@ -803,7 +803,7 @@ static void I830XvInit(ScrnInfoPtr pScrn) * As a result, we want to set up that server initialization once rather * that doing it per generation. */ -static Bool I830PreInit(ScrnInfoPtr pScrn, int flags) +static Bool I830PreInit(ScrnInfoPtr scrn, int flags) { intel_screen_private *intel; rgb defaultWeight = { 0, 0, 0 }; @@ -812,106 +812,106 @@ static Bool I830PreInit(ScrnInfoPtr pScrn, int flags) Gamma zeros = { 0.0, 0.0, 0.0 }; int drm_mode_setting; - if (pScrn->numEntities != 1) + if (scrn->numEntities != 1) return FALSE; - drm_mode_setting = i830_kernel_mode_enabled(pScrn); + drm_mode_setting = i830_kernel_mode_enabled(scrn); if (!drm_mode_setting) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + xf86DrvMsg(scrn->scrnIndex, X_ERROR, "No kernel modesetting driver detected.\n"); return FALSE; } - pEnt = xf86GetEntityInfo(pScrn->entityList[0]); + pEnt = xf86GetEntityInfo(scrn->entityList[0]); if (flags & PROBE_DETECT) return TRUE; /* Allocate driverPrivate */ - if (!I830GetRec(pScrn)) + if (!I830GetRec(scrn)) return FALSE; - intel = intel_get_screen_private(pScrn); + intel = intel_get_screen_private(scrn); intel->pEnt = pEnt; - pScrn->displayWidth = 640; /* default it */ + scrn->displayWidth = 640; /* default it */ if (intel->pEnt->location.type != BUS_PCI) return FALSE; intel->PciInfo = xf86GetPciInfoForEntity(intel->pEnt->index); - if (!i830_open_drm_master(pScrn)) - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + if (!i830_open_drm_master(scrn)) + xf86DrvMsg(scrn->scrnIndex, X_ERROR, "Failed to become DRM master.\n"); - pScrn->monitor = pScrn->confScreen->monitor; - pScrn->progClock = TRUE; - pScrn->rgbBits = 8; + scrn->monitor = scrn->confScreen->monitor; + scrn->progClock = TRUE; + scrn->rgbBits = 8; flags24 = Support32bppFb | PreferConvert24to32 | SupportConvert24to32; - if (!xf86SetDepthBpp(pScrn, 0, 0, 0, flags24)) + if (!xf86SetDepthBpp(scrn, 0, 0, 0, flags24)) return FALSE; - switch (pScrn->depth) { + switch (scrn->depth) { case 8: case 15: case 16: case 24: break; default: - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + xf86DrvMsg(scrn->scrnIndex, X_ERROR, "Given depth (%d) is not supported by I830 driver\n", - pScrn->depth); + scrn->depth); return FALSE; } - xf86PrintDepthBpp(pScrn); + xf86PrintDepthBpp(scrn); - if (!xf86SetWeight(pScrn, defaultWeight, defaultWeight)) + if (!xf86SetWeight(scrn, defaultWeight, defaultWeight)) return FALSE; - if (!xf86SetDefaultVisual(pScrn, -1)) + if (!xf86SetDefaultVisual(scrn, -1)) return FALSE; - intel->cpp = pScrn->bitsPerPixel / 8; + intel->cpp = scrn->bitsPerPixel / 8; - if (!I830GetEarlyOptions(pScrn)) + if (!I830GetEarlyOptions(scrn)) return FALSE; - i830_detect_chipset(pScrn); + i830_detect_chipset(scrn); - i830_check_dri_option(pScrn); + i830_check_dri_option(scrn); - I830XvInit(pScrn); + I830XvInit(scrn); - if (!I830DrmModeInit(pScrn)) + if (!I830DrmModeInit(scrn)) return FALSE; - if (!xf86SetGamma(pScrn, zeros)) { - PreInitCleanup(pScrn); + if (!xf86SetGamma(scrn, zeros)) { + PreInitCleanup(scrn); return FALSE; } - if (pScrn->modes == NULL) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "No modes.\n"); - PreInitCleanup(pScrn); + if (scrn->modes == NULL) { + xf86DrvMsg(scrn->scrnIndex, X_ERROR, "No modes.\n"); + PreInitCleanup(scrn); return FALSE; } - pScrn->currentMode = pScrn->modes; + scrn->currentMode = scrn->modes; /* Set display resolution */ - xf86SetDpi(pScrn, 0, 0); + xf86SetDpi(scrn, 0, 0); /* Load the required sub modules */ - if (!xf86LoadSubModule(pScrn, "fb")) { - PreInitCleanup(pScrn); + if (!xf86LoadSubModule(scrn, "fb")) { + PreInitCleanup(scrn); return FALSE; } /* Load the dri2 module if requested. */ if (xf86ReturnOptValBool(intel->Options, OPTION_DRI, FALSE) && intel->directRenderingType != DRI_DISABLED) { - xf86LoadSubModule(pScrn, "dri2"); + xf86LoadSubModule(scrn, "dri2"); } return TRUE; @@ -929,9 +929,9 @@ enum pipe { * function is also responsible for marking the state as clobbered for DRI * clients. */ -void IntelEmitInvarientState(ScrnInfoPtr pScrn) +void IntelEmitInvarientState(ScrnInfoPtr scrn) { - intel_screen_private *intel = intel_get_screen_private(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); /* If we've emitted our state since the last clobber by another client, * skip it. @@ -941,9 +941,9 @@ void IntelEmitInvarientState(ScrnInfoPtr pScrn) if (!IS_I965G(intel)) { if (IS_I9XX(intel)) - I915EmitInvarientState(pScrn); + I915EmitInvarientState(scrn); else - I830EmitInvarientState(pScrn); + I830EmitInvarientState(scrn); } } @@ -951,8 +951,8 @@ static void I830BlockHandler(int i, pointer blockData, pointer pTimeout, pointer pReadmask) { ScreenPtr pScreen = screenInfo.screens[i]; - ScrnInfoPtr pScrn = xf86Screens[i]; - intel_screen_private *intel = intel_get_screen_private(pScrn); + ScrnInfoPtr scrn = xf86Screens[i]; + intel_screen_private *intel = intel_get_screen_private(scrn); pScreen->BlockHandler = intel->BlockHandler; @@ -961,7 +961,7 @@ I830BlockHandler(int i, pointer blockData, pointer pTimeout, pointer pReadmask) intel->BlockHandler = pScreen->BlockHandler; pScreen->BlockHandler = I830BlockHandler; - if (pScrn->vtSema) { + if (scrn->vtSema) { Bool flushed = FALSE; /* Emit a flush of the rendering cache, or on the 965 and beyond * rendering results may not hit the framebuffer until significantly @@ -969,13 +969,13 @@ I830BlockHandler(int i, pointer blockData, pointer pTimeout, pointer pReadmask) */ if (intel->need_mi_flush || intel->batch_used) { flushed = TRUE; - I830EmitFlush(pScrn); + I830EmitFlush(scrn); } /* Flush the batch, so that any rendering is executed in a timely * fashion. */ - intel_batch_flush(pScrn, flushed); + intel_batch_flush(scrn, flushed); drmCommandNone(intel->drmSubFD, DRM_I915_GEM_THROTTLE); intel->need_mi_flush = FALSE; @@ -986,10 +986,10 @@ I830BlockHandler(int i, pointer blockData, pointer pTimeout, pointer pReadmask) I830VideoBlockHandler(i, blockData, pTimeout, pReadmask); } -static void i830_fixup_mtrrs(ScrnInfoPtr pScrn) +static void i830_fixup_mtrrs(ScrnInfoPtr scrn) { #ifdef HAS_MTRR_SUPPORT - intel_screen_private *intel = intel_get_screen_private(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); int fd; struct mtrr_gentry gentry; struct mtrr_sentry sentry; @@ -1011,7 +1011,7 @@ static void i830_fixup_mtrrs(ScrnInfoPtr pScrn) if (gentry.base == intel->LinearAddr && gentry.size < intel->FbMapSize) { - xf86DrvMsg(pScrn->scrnIndex, X_INFO, + xf86DrvMsg(scrn->scrnIndex, X_INFO, "Removing bad MTRR range (base 0x%lx, size 0x%x)\n", gentry.base, gentry.size); @@ -1020,7 +1020,7 @@ static void i830_fixup_mtrrs(ScrnInfoPtr pScrn) sentry.type = gentry.type; if (ioctl(fd, MTRRIOC_DEL_ENTRY, &sentry) == -1) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + xf86DrvMsg(scrn->scrnIndex, X_ERROR, "Failed to remove bad MTRR range\n"); } } @@ -1030,24 +1030,24 @@ static void i830_fixup_mtrrs(ScrnInfoPtr pScrn) #endif } -static Bool i830_try_memory_allocation(ScrnInfoPtr pScrn) +static Bool i830_try_memory_allocation(ScrnInfoPtr scrn) { - intel_screen_private *intel = intel_get_screen_private(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); Bool tiled = intel->tiling; - xf86DrvMsg(pScrn->scrnIndex, X_INFO, + xf86DrvMsg(scrn->scrnIndex, X_INFO, "Attempting memory allocation with %stiled buffers.\n", tiled ? "" : "un"); - if (!i830_allocate_2d_memory(pScrn)) + if (!i830_allocate_2d_memory(scrn)) goto failed; - xf86DrvMsg(pScrn->scrnIndex, X_INFO, "%siled allocation successful.\n", + xf86DrvMsg(scrn->scrnIndex, X_INFO, "%siled allocation successful.\n", tiled ? "T" : "Unt"); return TRUE; failed: - xf86DrvMsg(pScrn->scrnIndex, X_INFO, "%siled allocation failed.\n", + xf86DrvMsg(scrn->scrnIndex, X_INFO, "%siled allocation failed.\n", tiled ? "T" : "Unt"); return FALSE; } @@ -1061,47 +1061,47 @@ failed: * 3) And if all else fails, disable DRI and try just 2D allocations. * 4) Give up and fail ScreenInit. */ -static Bool i830_memory_init(ScrnInfoPtr pScrn) +static Bool i830_memory_init(ScrnInfoPtr scrn) { - intel_screen_private *intel = intel_get_screen_private(pScrn); - int savedDisplayWidth = pScrn->displayWidth; + intel_screen_private *intel = intel_get_screen_private(scrn); + int savedDisplayWidth = scrn->displayWidth; Bool tiled = FALSE; - tiled = i830_tiled_width(intel, &pScrn->displayWidth, intel->cpp); + tiled = i830_tiled_width(intel, &scrn->displayWidth, intel->cpp); /* Set up our video memory allocator for the chosen videoRam */ - if (!i830_allocator_init(pScrn, pScrn->videoRam * KB(1))) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + if (!i830_allocator_init(scrn, scrn->videoRam * KB(1))) { + xf86DrvMsg(scrn->scrnIndex, X_ERROR, "Couldn't initialize video memory allocator\n"); - PreInitCleanup(pScrn); + PreInitCleanup(scrn); return FALSE; } - xf86DrvMsg(pScrn->scrnIndex, + xf86DrvMsg(scrn->scrnIndex, intel->pEnt->device->videoRam ? X_CONFIG : X_DEFAULT, - "VideoRam: %d KB\n", pScrn->videoRam); + "VideoRam: %d KB\n", scrn->videoRam); /* Tiled first if we got a good displayWidth */ if (tiled) { - if (i830_try_memory_allocation(pScrn)) + if (i830_try_memory_allocation(scrn)) return TRUE; else { - i830_reset_allocations(pScrn); + i830_reset_allocations(scrn); intel->tiling = FALSE; } } /* If tiling fails we have to disable FBC */ - pScrn->displayWidth = savedDisplayWidth; + scrn->displayWidth = savedDisplayWidth; - if (i830_try_memory_allocation(pScrn)) + if (i830_try_memory_allocation(scrn)) return TRUE; return FALSE; } -void i830_init_bufmgr(ScrnInfoPtr pScrn) +void i830_init_bufmgr(ScrnInfoPtr scrn) { - intel_screen_private *intel = intel_get_screen_private(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); int batch_size; if (intel->bufmgr) @@ -1119,8 +1119,8 @@ void i830_init_bufmgr(ScrnInfoPtr pScrn) Bool i830_crtc_on(xf86CrtcPtr crtc) { - ScrnInfoPtr pScrn = crtc->scrn; - xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); + ScrnInfoPtr scrn = crtc->scrn; + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); int i, active_outputs = 0; /* Kernel manages CRTC status based out output config */ @@ -1138,8 +1138,8 @@ Bool i830_crtc_on(xf86CrtcPtr crtc) int i830_crtc_to_pipe(xf86CrtcPtr crtc) { - ScrnInfoPtr pScrn = crtc->scrn; - intel_screen_private *intel = intel_get_screen_private(pScrn); + ScrnInfoPtr scrn = crtc->scrn; + intel_screen_private *intel = intel_get_screen_private(scrn); return drmmode_get_pipe_from_crtc_id(intel->bufmgr, crtc); } @@ -1147,15 +1147,15 @@ int i830_crtc_to_pipe(xf86CrtcPtr crtc) static Bool I830ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];; - intel_screen_private *intel = intel_get_screen_private(pScrn);; + ScrnInfoPtr scrn = xf86Screens[pScreen->myNum];; + intel_screen_private *intel = intel_get_screen_private(scrn);; VisualPtr visual; MessageType from; struct pci_device *const device = intel->PciInfo; int fb_bar = IS_I9XX(intel) ? 2 : 0; - pScrn->displayWidth = - i830_pad_drawable_width(pScrn->virtualX, intel->cpp); + scrn->displayWidth = + i830_pad_drawable_width(scrn->virtualX, intel->cpp); /* * The "VideoRam" config file parameter specifies the maximum amount of @@ -1171,11 +1171,11 @@ I830ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) */ if (intel->pEnt->device->videoRam == 0) { from = X_DEFAULT; - pScrn->videoRam = intel->FbMapSize / KB(1); + scrn->videoRam = intel->FbMapSize / KB(1); } else { #if 0 from = X_CONFIG; - pScrn->videoRam = intel->pEnt->device->videoRam; + scrn->videoRam = intel->pEnt->device->videoRam; #else /* Disable VideoRam configuration, at least for now. Previously, * VideoRam was necessary to avoid overly low limits on allocated @@ -1185,22 +1185,22 @@ I830ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) * obsolete. */ from = X_DEFAULT; - pScrn->videoRam = intel->FbMapSize / KB(1); + scrn->videoRam = intel->FbMapSize / KB(1); - if (pScrn->videoRam != intel->pEnt->device->videoRam) { - xf86DrvMsg(pScrn->scrnIndex, X_WARNING, + if (scrn->videoRam != intel->pEnt->device->videoRam) { + xf86DrvMsg(scrn->scrnIndex, X_WARNING, "VideoRam configuration found, which is no longer " "recommended.\n"); - xf86DrvMsg(pScrn->scrnIndex, X_INFO, + xf86DrvMsg(scrn->scrnIndex, X_INFO, "Continuing with default %dkB VideoRam instead of %d " "kB.\n", - pScrn->videoRam, + scrn->videoRam, intel->pEnt->device->videoRam); } #endif } - pScrn->videoRam = device->regions[fb_bar].size / 1024; + scrn->videoRam = device->regions[fb_bar].size / 1024; #ifdef DRI2 if (intel->directRenderingType == DRI_NONE @@ -1231,9 +1231,9 @@ I830ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) intel->swapbuffers_wait = FALSE; } - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Tiling %sabled\n", + xf86DrvMsg(scrn->scrnIndex, X_CONFIG, "Tiling %sabled\n", intel->tiling ? "en" : "dis"); - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "SwapBuffers wait %sabled\n", + xf86DrvMsg(scrn->scrnIndex, X_CONFIG, "SwapBuffers wait %sabled\n", intel->swapbuffers_wait ? "en" : "dis"); intel->last_3d = LAST_3D_OTHER; @@ -1245,51 +1245,51 @@ I830ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) */ intel->XvEnabled = TRUE; - if (!i830_memory_init(pScrn)) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + if (!i830_memory_init(scrn)) { + xf86DrvMsg(scrn->scrnIndex, X_ERROR, "Couldn't allocate video memory\n"); return FALSE; } - i830_fixup_mtrrs(pScrn); + i830_fixup_mtrrs(scrn); miClearVisualTypes(); - if (!miSetVisualTypes(pScrn->depth, - miGetDefaultVisualMask(pScrn->depth), - pScrn->rgbBits, pScrn->defaultVisual)) + if (!miSetVisualTypes(scrn->depth, + miGetDefaultVisualMask(scrn->depth), + scrn->rgbBits, scrn->defaultVisual)) return FALSE; if (!miSetPixmapDepths()) return FALSE; DPRINTF(PFX, "assert( if(!I830EnterVT(scrnIndex, 0)) )\n"); - if (pScrn->virtualX > pScrn->displayWidth) - pScrn->displayWidth = pScrn->virtualX; + if (scrn->virtualX > scrn->displayWidth) + scrn->displayWidth = scrn->virtualX; /* If the front buffer is not a BO, we need to * set the initial framebuffer pixmap to point at * it */ - pScrn->fbOffset = intel->front_buffer->offset; + scrn->fbOffset = intel->front_buffer->offset; DPRINTF(PFX, "assert( if(!fbScreenInit(pScreen, ...) )\n"); if (!fbScreenInit(pScreen, NULL, - pScrn->virtualX, pScrn->virtualY, - pScrn->xDpi, pScrn->yDpi, - pScrn->displayWidth, pScrn->bitsPerPixel)) + scrn->virtualX, scrn->virtualY, + scrn->xDpi, scrn->yDpi, + scrn->displayWidth, scrn->bitsPerPixel)) return FALSE; - if (pScrn->bitsPerPixel > 8) { + if (scrn->bitsPerPixel > 8) { /* Fixup RGB ordering */ visual = pScreen->visuals + pScreen->numVisuals; while (--visual >= pScreen->visuals) { if ((visual->class | DynamicClass) == DirectColor) { - visual->offsetRed = pScrn->offset.red; - visual->offsetGreen = pScrn->offset.green; - visual->offsetBlue = pScrn->offset.blue; - visual->redMask = pScrn->mask.red; - visual->greenMask = pScrn->mask.green; - visual->blueMask = pScrn->mask.blue; + visual->offsetRed = scrn->offset.red; + visual->offsetGreen = scrn->offset.green; + visual->offsetBlue = scrn->offset.blue; + visual->redMask = scrn->mask.red; + visual->greenMask = scrn->mask.green; + visual->blueMask = scrn->mask.blue; } } } @@ -1299,7 +1299,7 @@ I830ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) xf86SetBlackWhitePixels(pScreen); if (!I830AccelInit(pScreen)) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + xf86DrvMsg(scrn->scrnIndex, X_ERROR, "Hardware acceleration initialization failed\n"); return FALSE; } @@ -1316,7 +1316,7 @@ I830ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) xf86SetSilkenMouse(pScreen); miDCInitialize(pScreen, xf86GetPointerScreenFuncs()); - xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Initializing HW Cursor\n"); + xf86DrvMsg(scrn->scrnIndex, X_INFO, "Initializing HW Cursor\n"); if (!xf86_cursors_init(pScreen, I810_CURSOR_X, I810_CURSOR_Y, (HARDWARE_CURSOR_TRUECOLOR_AT_8BPP | @@ -1327,13 +1327,13 @@ I830ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_64 | HARDWARE_CURSOR_UPDATE_UNHIDDEN | HARDWARE_CURSOR_ARGB))) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + xf86DrvMsg(scrn->scrnIndex, X_ERROR, "Hardware cursor initialization failed\n"); } /* Must force it before EnterVT, so we are in control of VT and * later memory should be bound when allocating, e.g rotate_mem */ - pScrn->vtSema = TRUE; + scrn->vtSema = TRUE; if (!I830EnterVT(scrnIndex, 0)) return FALSE; @@ -1368,7 +1368,7 @@ I830ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) from = ((intel->directRenderingType == DRI_DRI2) && xf86GetOptValBool(intel->Options, OPTION_XVMC, &intel->XvMCEnabled) ? X_CONFIG : X_DEFAULT); - xf86DrvMsg(pScrn->scrnIndex, from, "Intel XvMC decoder %sabled\n", + xf86DrvMsg(scrn->scrnIndex, from, "Intel XvMC decoder %sabled\n", intel->XvMCEnabled ? "en" : "dis"); #endif /* Init video */ @@ -1376,31 +1376,31 @@ I830ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) I830InitVideo(pScreen); /* Setup 3D engine, needed for rotation too */ - IntelEmitInvarientState(pScrn); + IntelEmitInvarientState(scrn); #if defined(DRI2) switch (intel->directRenderingType) { case DRI_DRI2: intel->directRenderingOpen = TRUE; - xf86DrvMsg(pScrn->scrnIndex, X_INFO, + xf86DrvMsg(scrn->scrnIndex, X_INFO, "direct rendering: DRI2 Enabled\n"); break; case DRI_DISABLED: - xf86DrvMsg(pScrn->scrnIndex, X_INFO, + xf86DrvMsg(scrn->scrnIndex, X_INFO, "direct rendering: Disabled\n"); break; case DRI_NONE: - xf86DrvMsg(pScrn->scrnIndex, X_INFO, + xf86DrvMsg(scrn->scrnIndex, X_INFO, "direct rendering: Failed\n"); break; } #else - xf86DrvMsg(pScrn->scrnIndex, X_INFO, + xf86DrvMsg(scrn->scrnIndex, X_INFO, "direct rendering: Not available\n"); #endif if (serverGeneration == 1) - xf86ShowUnusedOptions(pScrn->scrnIndex, pScrn->options); + xf86ShowUnusedOptions(scrn->scrnIndex, scrn->options); intel->suspended = FALSE; @@ -1413,14 +1413,14 @@ static void i830AdjustFrame(int scrnIndex, int x, int y, int flags) static void I830FreeScreen(int scrnIndex, int flags) { - ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; + ScrnInfoPtr scrn = xf86Screens[scrnIndex]; #ifdef INTEL_XVMC - intel_screen_private *intel = intel_get_screen_private(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); if (intel && intel->XvMCEnabled) intel_xvmc_finish(xf86Screens[scrnIndex]); #endif - i830_close_drm_master(pScrn); + i830_close_drm_master(scrn); I830FreeRec(xf86Screens[scrnIndex]); if (xf86LoaderCheckSymbol("vgaHWFreeHWRec")) @@ -1429,26 +1429,26 @@ static void I830FreeScreen(int scrnIndex, int flags) static void I830LeaveVT(int scrnIndex, int flags) { - ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; - intel_screen_private *intel = intel_get_screen_private(pScrn); + ScrnInfoPtr scrn = xf86Screens[scrnIndex]; + intel_screen_private *intel = intel_get_screen_private(scrn); int ret; DPRINTF(PFX, "Leave VT\n"); - xf86RotateFreeShadow(pScrn); + xf86RotateFreeShadow(scrn); - xf86_hide_cursors(pScrn); + xf86_hide_cursors(scrn); - I830Sync(pScrn); + I830Sync(scrn); - intel_batch_teardown(pScrn); + intel_batch_teardown(scrn); if (IS_I965G(intel)) - gen4_render_state_cleanup(pScrn); + gen4_render_state_cleanup(scrn); ret = drmDropMaster(intel->drmSubFD); if (ret) - xf86DrvMsg(pScrn->scrnIndex, X_WARNING, + xf86DrvMsg(scrn->scrnIndex, X_WARNING, "drmDropMaster failed: %s\n", strerror(errno)); } @@ -1457,8 +1457,8 @@ static void I830LeaveVT(int scrnIndex, int flags) */ static Bool I830EnterVT(int scrnIndex, int flags) { - ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; - intel_screen_private *intel = intel_get_screen_private(pScrn); + ScrnInfoPtr scrn = xf86Screens[scrnIndex]; + intel_screen_private *intel = intel_get_screen_private(scrn); int ret; DPRINTF(PFX, "Enter VT\n"); @@ -1466,49 +1466,49 @@ static Bool I830EnterVT(int scrnIndex, int flags) ret = drmSetMaster(intel->drmSubFD); if (ret) { if (errno == EINVAL) { - xf86DrvMsg(pScrn->scrnIndex, X_WARNING, + xf86DrvMsg(scrn->scrnIndex, X_WARNING, "drmSetMaster failed: 2.6.29 or newer kernel required for " "multi-server DRI\n"); } else { - xf86DrvMsg(pScrn->scrnIndex, X_WARNING, + xf86DrvMsg(scrn->scrnIndex, X_WARNING, "drmSetMaster failed: %s\n", strerror(errno)); } } - if (!i830_bind_all_memory(pScrn)) + if (!i830_bind_all_memory(scrn)) return FALSE; - i830_describe_allocations(pScrn, 1, ""); + i830_describe_allocations(scrn, 1, ""); - intel_batch_init(pScrn); + intel_batch_init(scrn); if (IS_I965G(intel)) - gen4_render_state_init(pScrn); + gen4_render_state_init(scrn); - if (!xf86SetDesiredModes(pScrn)) + if (!xf86SetDesiredModes(scrn)) return FALSE; /* Mark 3D state as being clobbered and setup the basics */ intel->last_3d = LAST_3D_OTHER; - IntelEmitInvarientState(pScrn); + IntelEmitInvarientState(scrn); return TRUE; } static Bool I830SwitchMode(int scrnIndex, DisplayModePtr mode, int flags) { - ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; + ScrnInfoPtr scrn = xf86Screens[scrnIndex]; - return xf86SetSingleMode(pScrn, mode, RR_Rotate_0); + return xf86SetSingleMode(scrn, mode, RR_Rotate_0); } static Bool I830CloseScreen(int scrnIndex, ScreenPtr pScreen) { - ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; - intel_screen_private *intel = intel_get_screen_private(pScrn); + ScrnInfoPtr scrn = xf86Screens[scrnIndex]; + intel_screen_private *intel = intel_get_screen_private(scrn); - if (pScrn->vtSema == TRUE) { + if (scrn->vtSema == TRUE) { I830LeaveVT(scrnIndex, 0); } @@ -1519,15 +1519,15 @@ static Bool I830CloseScreen(int scrnIndex, ScreenPtr pScreen) } if (intel->front_buffer) { i830_set_pixmap_bo(pScreen->GetScreenPixmap(pScreen), NULL); - i830_free_memory(pScrn, intel->front_buffer); + i830_free_memory(scrn, intel->front_buffer); intel->front_buffer = NULL; } xf86_cursors_fini(pScreen); - i830_allocator_fini(pScrn); + i830_allocator_fini(scrn); - i965_free_video(pScrn); + i965_free_video(scrn); pScreen->CloseScreen = intel->CloseScreen; (*pScreen->CloseScreen) (scrnIndex, pScreen); @@ -1540,7 +1540,7 @@ static Bool I830CloseScreen(int scrnIndex, ScreenPtr pScreen) xf86GARTCloseScreen(scrnIndex); - pScrn->vtSema = FALSE; + scrn->vtSema = FALSE; return TRUE; } @@ -1572,8 +1572,8 @@ I830ValidMode(int scrnIndex, DisplayModePtr mode, Bool verbose, int flags) */ static Bool I830PMEvent(int scrnIndex, pmEvent event, Bool undo) { - ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; - intel_screen_private *intel = intel_get_screen_private(pScrn); + ScrnInfoPtr scrn = xf86Screens[scrnIndex]; + intel_screen_private *intel = intel_get_screen_private(scrn); DPRINTF(PFX, "Enter VT, event %d, undo: %s\n", event, BOOLTOSTRING(undo)); @@ -1585,12 +1585,12 @@ static Bool I830PMEvent(int scrnIndex, pmEvent event, Bool undo) case XF86_APM_SYS_STANDBY: case XF86_APM_USER_STANDBY: if (!undo && !intel->suspended) { - pScrn->LeaveVT(scrnIndex, 0); + scrn->LeaveVT(scrnIndex, 0); intel->suspended = TRUE; sleep(SUSPEND_SLEEP); } else if (undo && intel->suspended) { sleep(RESUME_SLEEP); - pScrn->EnterVT(scrnIndex, 0); + scrn->EnterVT(scrnIndex, 0); intel->suspended = FALSE; } break; @@ -1599,7 +1599,7 @@ static Bool I830PMEvent(int scrnIndex, pmEvent event, Bool undo) case XF86_APM_CRITICAL_RESUME: if (intel->suspended) { sleep(RESUME_SLEEP); - pScrn->EnterVT(scrnIndex, 0); + scrn->EnterVT(scrnIndex, 0); intel->suspended = FALSE; /* * Turn the screen saver off when resuming. This seems to be @@ -1625,9 +1625,9 @@ static Bool I830PMEvent(int scrnIndex, pmEvent event, Bool undo) return TRUE; } -xf86CrtcPtr i830_pipe_to_crtc(ScrnInfoPtr pScrn, int pipe) +xf86CrtcPtr i830_pipe_to_crtc(ScrnInfoPtr scrn, int pipe) { - xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); int c; for (c = 0; c < config->num_crtc; c++) { @@ -1641,15 +1641,15 @@ xf86CrtcPtr i830_pipe_to_crtc(ScrnInfoPtr pScrn, int pipe) return NULL; } -void I830InitpScrn(ScrnInfoPtr pScrn) +void intel_init_scrn(ScrnInfoPtr scrn) { - pScrn->PreInit = I830PreInit; - pScrn->ScreenInit = I830ScreenInit; - pScrn->SwitchMode = I830SwitchMode; - pScrn->AdjustFrame = i830AdjustFrame; - pScrn->EnterVT = I830EnterVT; - pScrn->LeaveVT = I830LeaveVT; - pScrn->FreeScreen = I830FreeScreen; - pScrn->ValidMode = I830ValidMode; - pScrn->PMEvent = I830PMEvent; + scrn->PreInit = I830PreInit; + scrn->ScreenInit = I830ScreenInit; + scrn->SwitchMode = I830SwitchMode; + scrn->AdjustFrame = i830AdjustFrame; + scrn->EnterVT = I830EnterVT; + scrn->LeaveVT = I830LeaveVT; + scrn->FreeScreen = I830FreeScreen; + scrn->ValidMode = I830ValidMode; + scrn->PMEvent = I830PMEvent; } diff --git a/src/i830_hwmc.c b/src/i830_hwmc.c index 1233e0a7..c365dd5f 100644 --- a/src/i830_hwmc.c +++ b/src/i830_hwmc.c @@ -47,9 +47,9 @@ static Bool intel_xvmc_set_driver(struct intel_xvmc_driver *d) /* check chip type and load xvmc driver */ /* This must be first called! */ -Bool intel_xvmc_probe(ScrnInfoPtr pScrn) +Bool intel_xvmc_probe(ScrnInfoPtr scrn) { - intel_screen_private *intel = intel_get_screen_private(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); Bool ret = FALSE; if (!intel->XvMCEnabled) @@ -73,17 +73,17 @@ Bool intel_xvmc_probe(ScrnInfoPtr pScrn) return TRUE; } -void intel_xvmc_finish(ScrnInfoPtr pScrn) +void intel_xvmc_finish(ScrnInfoPtr scrn) { if (!xvmc_driver) return; - (*xvmc_driver->fini) (pScrn); + (*xvmc_driver->fini) (scrn); } Bool intel_xvmc_driver_init(ScreenPtr pScreen, XF86VideoAdaptorPtr xv_adaptor) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; - intel_screen_private *intel = intel_get_screen_private(pScrn); + ScrnInfoPtr scrn = xf86Screens[pScreen->myNum]; + intel_screen_private *intel = intel_get_screen_private(scrn); struct drm_i915_setparam sp; int ret; @@ -92,7 +92,7 @@ Bool intel_xvmc_driver_init(ScreenPtr pScreen, XF86VideoAdaptorPtr xv_adaptor) return FALSE; } - if (!(*xvmc_driver->init) (pScrn, xv_adaptor)) { + if (!(*xvmc_driver->init) (scrn, xv_adaptor)) { ErrorF("XvMC driver initialize failed.\n"); return FALSE; } @@ -110,21 +110,21 @@ Bool intel_xvmc_driver_init(ScreenPtr pScreen, XF86VideoAdaptorPtr xv_adaptor) Bool intel_xvmc_screen_init(ScreenPtr pScreen) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; - intel_screen_private *intel = intel_get_screen_private(pScrn); + ScrnInfoPtr scrn = xf86Screens[pScreen->myNum]; + intel_screen_private *intel = intel_get_screen_private(scrn); char buf[64]; if (!xvmc_driver) return FALSE; if (xf86XvMCScreenInit(pScreen, 1, &xvmc_driver->adaptor)) { - xf86DrvMsg(pScrn->scrnIndex, X_INFO, + xf86DrvMsg(scrn->scrnIndex, X_INFO, "[XvMC] %s driver initialized.\n", xvmc_driver->name); } else { - intel_xvmc_finish(pScrn); + intel_xvmc_finish(scrn); intel->XvMCEnabled = FALSE; - xf86DrvMsg(pScrn->scrnIndex, X_INFO, + xf86DrvMsg(scrn->scrnIndex, X_INFO, "[XvMC] Failed to initialize XvMC.\n"); return FALSE; } @@ -140,12 +140,12 @@ Bool intel_xvmc_screen_init(ScreenPtr pScreen) return TRUE; } -Bool intel_xvmc_init_batch(ScrnInfoPtr pScrn) +Bool intel_xvmc_init_batch(ScrnInfoPtr scrn) { - intel_screen_private *intel = intel_get_screen_private(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); int size = KB(64); - if (!i830_allocate_xvmc_buffer(pScrn, "[XvMC] batch buffer", + if (!i830_allocate_xvmc_buffer(scrn, "[XvMC] batch buffer", &(xvmc_driver->batch), size, ALIGN_BOTH_ENDS)) return FALSE; @@ -155,23 +155,23 @@ Bool intel_xvmc_init_batch(ScrnInfoPtr pScrn) intel->LinearAddr), xvmc_driver->batch->size, DRM_AGP, 0, &xvmc_driver->batch_handle) < 0) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + xf86DrvMsg(scrn->scrnIndex, X_ERROR, "[drm] drmAddMap(batchbuffer_handle) failed!\n"); return FALSE; } return TRUE; } -void intel_xvmc_fini_batch(ScrnInfoPtr pScrn) +void intel_xvmc_fini_batch(ScrnInfoPtr scrn) { - intel_screen_private *intel = intel_get_screen_private(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); if (xvmc_driver->batch_handle) { drmRmMap(intel->drmSubFD, xvmc_driver->batch_handle); xvmc_driver->batch_handle = 0; } if (xvmc_driver->batch) { - i830_free_xvmc_buffer(pScrn, xvmc_driver->batch); + i830_free_xvmc_buffer(scrn, xvmc_driver->batch); xvmc_driver->batch = NULL; } } diff --git a/src/i830_memory.c b/src/i830_memory.c index 1730a7c8..957f5983 100644 --- a/src/i830_memory.c +++ b/src/i830_memory.c @@ -153,9 +153,9 @@ static unsigned long i830_get_fence_alignment(intel_screen_private *intel, unsig } static Bool -i830_check_display_stride(ScrnInfoPtr pScrn, int stride, Bool tiling) +i830_check_display_stride(ScrnInfoPtr scrn, int stride, Bool tiling) { - intel_screen_private *intel = intel_get_screen_private(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); int limit = KB(32); /* 8xx spec has always 8K limit, but tests show larger limit in @@ -175,13 +175,13 @@ i830_check_display_stride(ScrnInfoPtr pScrn, int stride, Bool tiling) return FALSE; } -void i830_free_memory(ScrnInfoPtr pScrn, i830_memory * mem) +void i830_free_memory(ScrnInfoPtr scrn, i830_memory * mem) { if (mem == NULL) return; if (mem->bo != NULL) { - intel_screen_private *intel = intel_get_screen_private(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); dri_bo_unreference(mem->bo); if (intel->bo_list == mem) { intel->bo_list = mem->next; @@ -210,21 +210,21 @@ void i830_free_memory(ScrnInfoPtr pScrn, i830_memory * mem) /* Resets the state of the aperture allocator, freeing all memory that had * been allocated. */ -void i830_reset_allocations(ScrnInfoPtr pScrn) +void i830_reset_allocations(ScrnInfoPtr scrn) { - intel_screen_private *intel = intel_get_screen_private(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); int p; /* While there is any memory between the start and end markers, free it. */ while (intel->memory_list->next->next != NULL) { i830_memory *mem = intel->memory_list->next; - i830_free_memory(pScrn, mem); + i830_free_memory(scrn, mem); } /* Free any allocations in buffer objects */ while (intel->bo_list != NULL) - i830_free_memory(pScrn, intel->bo_list); + i830_free_memory(scrn, intel->bo_list); /* Null out the pointers for all the allocations we just freed. This is * kind of gross, but at least it's just one place now. @@ -244,9 +244,9 @@ void i830_reset_allocations(ScrnInfoPtr pScrn) * static allocations. Some of these exist because of the need for physical * addresses to reference. */ -Bool i830_allocator_init(ScrnInfoPtr pScrn, unsigned long size) +Bool i830_allocator_init(ScrnInfoPtr scrn, unsigned long size) { - intel_screen_private *intel = intel_get_screen_private(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); i830_memory *start, *end; start = xcalloc(1, sizeof(*start)); @@ -285,12 +285,12 @@ Bool i830_allocator_init(ScrnInfoPtr pScrn, unsigned long size) return TRUE; } -void i830_allocator_fini(ScrnInfoPtr pScrn) +void i830_allocator_fini(ScrnInfoPtr scrn) { - intel_screen_private *intel = intel_get_screen_private(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); /* Free most of the allocations */ - i830_reset_allocations(pScrn); + i830_reset_allocations(scrn); /* Free the start/end markers */ free(intel->memory_list->next); @@ -298,13 +298,13 @@ void i830_allocator_fini(ScrnInfoPtr pScrn) intel->memory_list = NULL; } -static i830_memory *i830_allocate_memory_bo(ScrnInfoPtr pScrn, const char *name, +static i830_memory *i830_allocate_memory_bo(ScrnInfoPtr scrn, const char *name, unsigned long size, unsigned long pitch, unsigned long align, int flags, enum tile_format tile_format) { - intel_screen_private *intel = intel_get_screen_private(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); i830_memory *mem; uint32_t bo_tiling_mode = I915_TILING_NONE; int ret; @@ -358,7 +358,7 @@ static i830_memory *i830_allocate_memory_bo(ScrnInfoPtr pScrn, const char *name, if (ret != 0 || (bo_tiling_mode == I915_TILING_NONE && tile_format != TILE_NONE)) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + xf86DrvMsg(scrn->scrnIndex, X_ERROR, "Failed to set tiling on %s: %s\n", mem->name, ret == 0 ? "rejected by kernel" : strerror(errno)); mem->tiling = TILE_NONE; @@ -395,13 +395,13 @@ static i830_memory *i830_allocate_memory_bo(ScrnInfoPtr pScrn, const char *name, * the entire Screen lifetime. This means not using buffer objects, which * get their offsets chosen at each EnterVT time. */ -i830_memory *i830_allocate_memory(ScrnInfoPtr pScrn, const char *name, +i830_memory *i830_allocate_memory(ScrnInfoPtr scrn, const char *name, unsigned long size, unsigned long pitch, unsigned long alignment, int flags, enum tile_format tile_format) { i830_memory *mem; - intel_screen_private *intel = intel_get_screen_private(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); /* Manage tile alignment and size constraints */ if (tile_format != TILE_NONE) { @@ -422,31 +422,31 @@ i830_memory *i830_allocate_memory(ScrnInfoPtr pScrn, const char *name, alignment = i830_get_fence_alignment(intel, size); } - return i830_allocate_memory_bo(pScrn, name, size, + return i830_allocate_memory_bo(scrn, name, size, pitch, alignment, flags, tile_format); return mem; } void -i830_describe_allocations(ScrnInfoPtr pScrn, int verbosity, const char *prefix) +i830_describe_allocations(ScrnInfoPtr scrn, int verbosity, const char *prefix) { - intel_screen_private *intel = intel_get_screen_private(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); i830_memory *mem; if (intel->memory_list == NULL) { - xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, verbosity, + xf86DrvMsgVerb(scrn->scrnIndex, X_INFO, verbosity, "%sMemory allocator not initialized\n", prefix); return; } if (intel->memory_list->next->next == NULL) { - xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, verbosity, + xf86DrvMsgVerb(scrn->scrnIndex, X_INFO, verbosity, "%sNo memory allocations\n", prefix); return; } - xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, verbosity, + xf86DrvMsgVerb(scrn->scrnIndex, X_INFO, verbosity, "%sFixed memory allocation layout:\n", prefix); for (mem = intel->memory_list->next; mem->next != NULL; mem = mem->next) { @@ -458,16 +458,16 @@ i830_describe_allocations(ScrnInfoPtr pScrn, int verbosity, const char *prefix) else if (mem->tiling == TILE_YMAJOR) tile_suffix = " Y tiled"; - xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, verbosity, + xf86DrvMsgVerb(scrn->scrnIndex, X_INFO, verbosity, "%s0x%08lx-0x%08lx: %s (%ld kB%s)%s\n", prefix, mem->offset, mem->end - 1, mem->name, mem->size / 1024, phys_suffix, tile_suffix); } - xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, verbosity, + xf86DrvMsgVerb(scrn->scrnIndex, X_INFO, verbosity, "%s0x%08lx: end of aperture\n", prefix, intel->FbMapSize); - xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, verbosity, + xf86DrvMsgVerb(scrn->scrnIndex, X_INFO, verbosity, "%sBO memory allocation layout:\n", prefix); for (mem = intel->bo_list; mem != NULL; mem = mem->next) { char *tile_suffix = ""; @@ -477,15 +477,15 @@ i830_describe_allocations(ScrnInfoPtr pScrn, int verbosity, const char *prefix) else if (mem->tiling == TILE_YMAJOR) tile_suffix = " Y tiled"; - xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, verbosity, + xf86DrvMsgVerb(scrn->scrnIndex, X_INFO, verbosity, "%sunpinned : %s (%ld kB)%s\n", prefix, mem->name, mem->size / 1024, tile_suffix); } } -static Bool IsTileable(ScrnInfoPtr pScrn, int pitch) +static Bool IsTileable(ScrnInfoPtr scrn, int pitch) { - intel_screen_private *intel = intel_get_screen_private(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); if (IS_I965G(intel)) { if (pitch / 512 * 512 == pitch && pitch <= KB(128)) @@ -522,10 +522,10 @@ static Bool IsTileable(ScrnInfoPtr pScrn, int pitch) * Used once for each X screen, so once with RandR 1.2 and twice with classic * dualhead. */ -i830_memory *i830_allocate_framebuffer(ScrnInfoPtr pScrn) +i830_memory *i830_allocate_framebuffer(ScrnInfoPtr scrn) { - intel_screen_private *intel = intel_get_screen_private(pScrn); - unsigned int pitch = pScrn->displayWidth * intel->cpp; + intel_screen_private *intel = intel_get_screen_private(scrn); + unsigned int pitch = scrn->displayWidth * intel->cpp; unsigned long minspace; int align; long size, fb_height; @@ -538,24 +538,24 @@ i830_memory *i830_allocate_framebuffer(ScrnInfoPtr pScrn) /* We'll allocate the fb such that the root window will fit regardless of * rotation. */ - fb_height = pScrn->virtualY; + fb_height = scrn->virtualY; /* Calculate how much framebuffer memory to allocate. For the * initial allocation, calculate a reasonable minimum. This is * enough for the virtual screen size. */ - minspace = pitch * pScrn->virtualY; + minspace = pitch * scrn->virtualY; size = ROUND_TO_PAGE(pitch * fb_height); if (intel->tiling) tile_format = TILE_XMAJOR; - if (!IsTileable(pScrn, pitch)) + if (!IsTileable(scrn, pitch)) tile_format = TILE_NONE; - if (!i830_check_display_stride(pScrn, pitch, tile_format != TILE_NONE)) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + if (!i830_check_display_stride(scrn, pitch, tile_format != TILE_NONE)) { + xf86DrvMsg(scrn->scrnIndex, X_ERROR, "Front buffer stride %d kB " "exceed display limit\n", pitch / 1024); return NULL; @@ -570,24 +570,24 @@ i830_memory *i830_allocate_framebuffer(ScrnInfoPtr pScrn) align = KB(512); } else align = KB(64); - front_buffer = i830_allocate_memory(pScrn, "front buffer", size, + front_buffer = i830_allocate_memory(scrn, "front buffer", size, pitch, align, flags, tile_format); if (front_buffer == NULL) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + xf86DrvMsg(scrn->scrnIndex, X_ERROR, "Failed to allocate framebuffer.\n"); return NULL; } - i830_set_max_gtt_map_size(pScrn); + i830_set_max_gtt_map_size(scrn); return front_buffer; } -static Bool i830_allocate_cursor_buffers(ScrnInfoPtr pScrn) +static Bool i830_allocate_cursor_buffers(ScrnInfoPtr scrn) { - intel_screen_private *intel = intel_get_screen_private(pScrn); - xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); int i; /* @@ -597,7 +597,7 @@ static Bool i830_allocate_cursor_buffers(ScrnInfoPtr pScrn) */ for (i = 0; i < xf86_config->num_crtc; i++) { intel->cursor_mem_argb[i] = - i830_allocate_memory(pScrn, "ARGB cursor", + i830_allocate_memory(scrn, "ARGB cursor", HWCURSOR_SIZE_ARGB, PITCH_NONE, GTT_PAGE_SIZE, DISABLE_REUSE, TILE_NONE); @@ -612,18 +612,18 @@ static Bool i830_allocate_cursor_buffers(ScrnInfoPtr pScrn) * Allocate memory for 2D operation. This includes the (front) framebuffer, * ring buffer, scratch memory, HW cursor. */ -Bool i830_allocate_2d_memory(ScrnInfoPtr pScrn) +Bool i830_allocate_2d_memory(ScrnInfoPtr scrn) { - intel_screen_private *intel = intel_get_screen_private(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); /* Next, allocate other fixed-size allocations we have. */ - if (!i830_allocate_cursor_buffers(pScrn)) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + if (!i830_allocate_cursor_buffers(scrn)) { + xf86DrvMsg(scrn->scrnIndex, X_ERROR, "Failed to allocate HW cursor space.\n"); return FALSE; } - intel->front_buffer = i830_allocate_framebuffer(pScrn); + intel->front_buffer = i830_allocate_framebuffer(scrn); if (intel->front_buffer == NULL) return FALSE; @@ -637,23 +637,23 @@ Bool i830_allocate_2d_memory(ScrnInfoPtr pScrn) * intel points to the same allocation list, but the bind_memory will just * no-op then. */ -Bool i830_bind_all_memory(ScrnInfoPtr pScrn) +Bool i830_bind_all_memory(ScrnInfoPtr scrn) { - intel_screen_private *intel = intel_get_screen_private(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); if (intel->memory_list == NULL) return TRUE; int i; - xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); for (i = 0; i < xf86_config->num_crtc; i++) drmmode_crtc_set_cursor_bo(xf86_config->crtc[i], intel->cursor_mem_argb[i]->bo); - i830_set_max_gtt_map_size(pScrn); + i830_set_max_gtt_map_size(scrn); if (intel->front_buffer) - pScrn->fbOffset = intel->front_buffer->offset; + scrn->fbOffset = intel->front_buffer->offset; return TRUE; } @@ -662,23 +662,23 @@ Bool i830_bind_all_memory(ScrnInfoPtr pScrn) /* * Allocate memory for MC compensation */ -Bool i830_allocate_xvmc_buffer(ScrnInfoPtr pScrn, const char *name, +Bool i830_allocate_xvmc_buffer(ScrnInfoPtr scrn, const char *name, i830_memory ** buffer, unsigned long size, int flags) { - *buffer = i830_allocate_memory(pScrn, name, size, PITCH_NONE, + *buffer = i830_allocate_memory(scrn, name, size, PITCH_NONE, GTT_PAGE_SIZE, flags, TILE_NONE); if (!*buffer) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + xf86DrvMsg(scrn->scrnIndex, X_ERROR, "Failed to allocate memory for %s.\n", name); return FALSE; } if ((*buffer)->bo) { if (drm_intel_bo_pin((*buffer)->bo, GTT_PAGE_SIZE)) { - i830_free_memory(pScrn, *buffer); - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + i830_free_memory(scrn, *buffer); + xf86DrvMsg(scrn->scrnIndex, X_ERROR, "Failed to bind XvMC buffer bo!\n"); return FALSE; } @@ -689,19 +689,19 @@ Bool i830_allocate_xvmc_buffer(ScrnInfoPtr pScrn, const char *name, return TRUE; } -void i830_free_xvmc_buffer(ScrnInfoPtr pScrn, i830_memory * buffer) +void i830_free_xvmc_buffer(ScrnInfoPtr scrn, i830_memory * buffer) { if (buffer->bo) drm_intel_bo_unpin(buffer->bo); - i830_free_memory(pScrn, buffer); + i830_free_memory(scrn, buffer); } #endif -void i830_set_max_gtt_map_size(ScrnInfoPtr pScrn) +void i830_set_max_gtt_map_size(ScrnInfoPtr scrn) { - intel_screen_private *intel = intel_get_screen_private(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); struct drm_i915_gem_get_aperture aperture; int ret; diff --git a/src/i830_render.c b/src/i830_render.c index 4969e0b6..c4b264d2 100644 --- a/src/i830_render.c +++ b/src/i830_render.c @@ -164,9 +164,9 @@ static Bool i830_get_dest_format(PicturePtr pDstPicture, uint32_t * dst_format) break; default: { - ScrnInfoPtr pScrn; + ScrnInfoPtr scrn; - pScrn = + scrn = xf86Screens[pDstPicture->pDrawable->pScreen->myNum]; I830FALLBACK("Unsupported dest format 0x%x\n", (int)pDstPicture->format); @@ -176,7 +176,7 @@ static Bool i830_get_dest_format(PicturePtr pDstPicture, uint32_t * dst_format) return TRUE; } -static Bool i830_get_blend_cntl(ScrnInfoPtr pScrn, int op, PicturePtr pMask, +static Bool i830_get_blend_cntl(ScrnInfoPtr scrn, int op, PicturePtr pMask, uint32_t dst_format, uint32_t * blendctl) { uint32_t sblend, dblend; @@ -222,7 +222,7 @@ static Bool i830_get_blend_cntl(ScrnInfoPtr pScrn, int op, PicturePtr pMask, return TRUE; } -static Bool i830_check_composite_texture(ScrnInfoPtr pScrn, PicturePtr pPict, +static Bool i830_check_composite_texture(ScrnInfoPtr scrn, PicturePtr pPict, int unit) { if (pPict->repeatType > RepeatReflect) @@ -270,8 +270,8 @@ static uint32_t i8xx_get_card_format(PicturePtr pPict) static void i830_texture_setup(PicturePtr pPict, PixmapPtr pPix, int unit) { - ScrnInfoPtr pScrn = xf86Screens[pPict->pDrawable->pScreen->myNum]; - intel_screen_private *intel = intel_get_screen_private(pScrn); + ScrnInfoPtr scrn = xf86Screens[pPict->pDrawable->pScreen->myNum]; + intel_screen_private *intel = intel_get_screen_private(scrn); uint32_t format, pitch, filter; uint32_t wrap_mode; uint32_t texcoordtype; @@ -371,7 +371,7 @@ Bool i830_check_composite(int op, PicturePtr pSrcPicture, PicturePtr pMaskPicture, PicturePtr pDstPicture) { - ScrnInfoPtr pScrn = xf86Screens[pDstPicture->pDrawable->pScreen->myNum]; + ScrnInfoPtr scrn = xf86Screens[pDstPicture->pDrawable->pScreen->myNum]; uint32_t tmp1; /* Check for unsupported compositing operations. */ @@ -391,10 +391,10 @@ i830_check_composite(int op, PicturePtr pSrcPicture, PicturePtr pMaskPicture, "alpha and source value blending.\n"); } - if (!i830_check_composite_texture(pScrn, pSrcPicture, 0)) + if (!i830_check_composite_texture(scrn, pSrcPicture, 0)) I830FALLBACK("Check Src picture texture\n"); if (pMaskPicture != NULL - && !i830_check_composite_texture(pScrn, pMaskPicture, 1)) + && !i830_check_composite_texture(scrn, pMaskPicture, 1)) I830FALLBACK("Check Mask picture texture\n"); if (!i830_get_dest_format(pDstPicture, &tmp1)) @@ -408,8 +408,8 @@ i830_prepare_composite(int op, PicturePtr pSrcPicture, PicturePtr pMaskPicture, PicturePtr pDstPicture, PixmapPtr pSrc, PixmapPtr pMask, PixmapPtr pDst) { - ScrnInfoPtr pScrn = xf86Screens[pDstPicture->pDrawable->pScreen->myNum]; - intel_screen_private *intel = intel_get_screen_private(pScrn); + ScrnInfoPtr scrn = xf86Screens[pDstPicture->pDrawable->pScreen->myNum]; + intel_screen_private *intel = intel_get_screen_private(scrn); intel->render_src_picture = pSrcPicture; intel->render_src = pSrc; @@ -518,7 +518,7 @@ i830_prepare_composite(int op, PicturePtr pSrcPicture, } if (!i830_get_blend_cntl - (pScrn, op, pMaskPicture, pDstPicture->format, &blendctl)) { + (scrn, op, pMaskPicture, pDstPicture->format, &blendctl)) { return FALSE; } @@ -527,22 +527,22 @@ i830_prepare_composite(int op, PicturePtr pSrcPicture, intel->s8_blendctl = blendctl; } - i830_debug_sync(pScrn); + i830_debug_sync(scrn); intel->needs_render_state_emit = TRUE; return TRUE; } -static void i830_emit_composite_state(ScrnInfoPtr pScrn) +static void i830_emit_composite_state(ScrnInfoPtr scrn) { - intel_screen_private *intel = intel_get_screen_private(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); uint32_t vf2; uint32_t texcoordfmt = 0; intel->needs_render_state_emit = FALSE; - IntelEmitInvarientState(pScrn); + IntelEmitInvarientState(scrn); intel->last_3d = LAST_3D_RENDER; BEGIN_BATCH(21); @@ -622,8 +622,8 @@ i830_emit_composite_primitive(PixmapPtr pDst, int maskX, int maskY, int dstX, int dstY, int w, int h) { - ScrnInfoPtr pScrn = xf86Screens[pDst->drawable.pScreen->myNum]; - intel_screen_private *intel = intel_get_screen_private(pScrn); + ScrnInfoPtr scrn = xf86Screens[pDst->drawable.pScreen->myNum]; + intel_screen_private *intel = intel_get_screen_private(scrn); Bool is_affine_src, is_affine_mask = TRUE; int per_vertex, num_floats; float src_x[3], src_y[3], src_w[3], mask_x[3], mask_y[3], mask_w[3]; @@ -804,23 +804,23 @@ void i830_composite(PixmapPtr pDst, int srcX, int srcY, int maskX, int maskY, int dstX, int dstY, int w, int h) { - ScrnInfoPtr pScrn = xf86Screens[pDst->drawable.pScreen->myNum]; - intel_screen_private *intel = intel_get_screen_private(pScrn); + ScrnInfoPtr scrn = xf86Screens[pDst->drawable.pScreen->myNum]; + intel_screen_private *intel = intel_get_screen_private(scrn); - intel_batch_start_atomic(pScrn, 58 + /* invarient */ + intel_batch_start_atomic(scrn, 58 + /* invarient */ 22 + /* setup */ 20 + /* 2 * setup_texture */ 1 + 30 /* verts */ ); if (intel->needs_render_state_emit) - i830_emit_composite_state(pScrn); + i830_emit_composite_state(scrn); i830_emit_composite_primitive(pDst, srcX, srcY, maskX, maskY, dstX, dstY, w, h); - intel_batch_end_atomic(pScrn); + intel_batch_end_atomic(scrn); - i830_debug_sync(pScrn); + i830_debug_sync(scrn); } void i830_batch_flush_notify(ScrnInfoPtr scrn) diff --git a/src/i830_ring.h b/src/i830_ring.h index efa61c6c..994b6d24 100644 --- a/src/i830_ring.h +++ b/src/i830_ring.h @@ -76,12 +76,12 @@ do { \ FatalError("%s: BEGIN_LP_RING called without closing " \ "ADVANCE_LP_RING\n", __FUNCTION__); \ if ((n) > 2 && (I810_DEBUG&DEBUG_ALWAYS_SYNC)) \ - i830_wait_ring_idle(pScrn); \ + i830_wait_ring_idle(scrn); \ intel->ring_emitting = (n) * 4; \ if ((n) & 1) \ intel->ring_emitting += 4; \ if (intel->ring.space < intel->ring_emitting) \ - WaitRingFunc(pScrn, intel->ring_emitting, 0); \ + WaitRingFunc(scrn, intel->ring_emitting, 0); \ intel->ring_next = intel->ring.tail; \ if (I810_DEBUG & DEBUG_VERBOSE_RING) \ ErrorF( "BEGIN_LP_RING %d in %s\n", n, FUNCTION_NAME); \ diff --git a/src/i830_uxa.c b/src/i830_uxa.c index f28731f9..f94b2c90 100644 --- a/src/i830_uxa.c +++ b/src/i830_uxa.c @@ -105,17 +105,17 @@ Bool i830_pixmap_tiled(PixmapPtr pPixmap) } Bool -i830_get_aperture_space(ScrnInfoPtr pScrn, drm_intel_bo ** bo_table, +i830_get_aperture_space(ScrnInfoPtr scrn, drm_intel_bo ** bo_table, int num_bos) { - intel_screen_private *intel = intel_get_screen_private(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); if (intel->batch_bo == NULL) I830FALLBACK("VT inactive\n"); bo_table[0] = intel->batch_bo; if (drm_intel_bufmgr_check_aperture_space(bo_table, num_bos) != 0) { - intel_batch_flush(pScrn, FALSE); + intel_batch_flush(scrn, FALSE); bo_table[0] = intel->batch_bo; if (drm_intel_bufmgr_check_aperture_space(bo_table, num_bos) != 0) @@ -131,8 +131,8 @@ static unsigned long i830_pixmap_pitch(PixmapPtr pixmap) static int i830_pixmap_pitch_is_aligned(PixmapPtr pixmap) { - ScrnInfoPtr pScrn = xf86Screens[pixmap->drawable.pScreen->myNum]; - intel_screen_private *intel = intel_get_screen_private(pScrn); + ScrnInfoPtr scrn = xf86Screens[pixmap->drawable.pScreen->myNum]; + intel_screen_private *intel = intel_get_screen_private(scrn); return i830_pixmap_pitch(pixmap) % intel->accel_pixmap_pitch_alignment == 0; @@ -144,8 +144,8 @@ static int i830_pixmap_pitch_is_aligned(PixmapPtr pixmap) static Bool i830_uxa_prepare_solid(PixmapPtr pPixmap, int alu, Pixel planemask, Pixel fg) { - ScrnInfoPtr pScrn = xf86Screens[pPixmap->drawable.pScreen->myNum]; - intel_screen_private *intel = intel_get_screen_private(pScrn); + ScrnInfoPtr scrn = xf86Screens[pPixmap->drawable.pScreen->myNum]; + intel_screen_private *intel = intel_get_screen_private(scrn); unsigned long pitch; drm_intel_bo *bo_table[] = { NULL, /* batch_bo */ @@ -168,7 +168,7 @@ i830_uxa_prepare_solid(PixmapPtr pPixmap, int alu, Pixel planemask, Pixel fg) if (!i830_pixmap_pitch_is_aligned(pPixmap)) I830FALLBACK("pixmap pitch not aligned"); - if (!i830_get_aperture_space(pScrn, bo_table, ARRAY_SIZE(bo_table))) + if (!i830_get_aperture_space(scrn, bo_table, ARRAY_SIZE(bo_table))) return FALSE; intel->BR[13] = (I830PatternROP[alu] & 0xff) << 16; @@ -190,8 +190,8 @@ i830_uxa_prepare_solid(PixmapPtr pPixmap, int alu, Pixel planemask, Pixel fg) static void i830_uxa_solid(PixmapPtr pPixmap, int x1, int y1, int x2, int y2) { - ScrnInfoPtr pScrn = xf86Screens[pPixmap->drawable.pScreen->myNum]; - intel_screen_private *intel = intel_get_screen_private(pScrn); + ScrnInfoPtr scrn = xf86Screens[pPixmap->drawable.pScreen->myNum]; + intel_screen_private *intel = intel_get_screen_private(scrn); unsigned long pitch; uint32_t cmd; @@ -226,9 +226,9 @@ static void i830_uxa_solid(PixmapPtr pPixmap, int x1, int y1, int x2, int y2) static void i830_uxa_done_solid(PixmapPtr pPixmap) { - ScrnInfoPtr pScrn = xf86Screens[pPixmap->drawable.pScreen->myNum]; + ScrnInfoPtr scrn = xf86Screens[pPixmap->drawable.pScreen->myNum]; - i830_debug_sync(pScrn); + i830_debug_sync(scrn); } /** @@ -239,8 +239,8 @@ static Bool i830_uxa_prepare_copy(PixmapPtr pSrcPixmap, PixmapPtr pDstPixmap, int xdir, int ydir, int alu, Pixel planemask) { - ScrnInfoPtr pScrn = xf86Screens[pDstPixmap->drawable.pScreen->myNum]; - intel_screen_private *intel = intel_get_screen_private(pScrn); + ScrnInfoPtr scrn = xf86Screens[pDstPixmap->drawable.pScreen->myNum]; + intel_screen_private *intel = intel_get_screen_private(scrn); drm_intel_bo *bo_table[] = { NULL, /* batch_bo */ i830_get_pixmap_bo(pSrcPixmap), @@ -253,7 +253,7 @@ i830_uxa_prepare_copy(PixmapPtr pSrcPixmap, PixmapPtr pDstPixmap, int xdir, if (pDstPixmap->drawable.bitsPerPixel < 8) I830FALLBACK("under 8bpp pixmaps unsupported\n"); - if (!i830_get_aperture_space(pScrn, bo_table, ARRAY_SIZE(bo_table))) + if (!i830_get_aperture_space(scrn, bo_table, ARRAY_SIZE(bo_table))) return FALSE; i830_exa_check_pitch_2d(pSrcPixmap); @@ -280,8 +280,8 @@ static void i830_uxa_copy(PixmapPtr pDstPixmap, int src_x1, int src_y1, int dst_x1, int dst_y1, int w, int h) { - ScrnInfoPtr pScrn = xf86Screens[pDstPixmap->drawable.pScreen->myNum]; - intel_screen_private *intel = intel_get_screen_private(pScrn); + ScrnInfoPtr scrn = xf86Screens[pDstPixmap->drawable.pScreen->myNum]; + intel_screen_private *intel = intel_get_screen_private(scrn); uint32_t cmd; int dst_x2, dst_y2; unsigned int dst_pitch, src_pitch; @@ -334,9 +334,9 @@ i830_uxa_copy(PixmapPtr pDstPixmap, int src_x1, int src_y1, int dst_x1, static void i830_uxa_done_copy(PixmapPtr pDstPixmap) { - ScrnInfoPtr pScrn = xf86Screens[pDstPixmap->drawable.pScreen->myNum]; + ScrnInfoPtr scrn = xf86Screens[pDstPixmap->drawable.pScreen->myNum]; - i830_debug_sync(pScrn); + i830_debug_sync(scrn); } /** @@ -346,9 +346,9 @@ static void i830_uxa_done_copy(PixmapPtr pDstPixmap) */ void i830_done_composite(PixmapPtr pDst) { - ScrnInfoPtr pScrn = xf86Screens[pDst->drawable.pScreen->myNum]; + ScrnInfoPtr scrn = xf86Screens[pDst->drawable.pScreen->myNum]; - i830_debug_sync(pScrn); + i830_debug_sync(scrn); } #define xFixedToFloat(val) \ diff --git a/src/i830_video.c b/src/i830_video.c index 1667ca0b..329070d8 100644 --- a/src/i830_video.c +++ b/src/i830_video.c @@ -226,10 +226,10 @@ static void CompareOverlay(intel_screen_private *intel, uint32_t * overlay, int #endif /* kernel modesetting overlay functions */ -static Bool drmmode_has_overlay(ScrnInfoPtr pScrn) +static Bool drmmode_has_overlay(ScrnInfoPtr scrn) { #ifdef DRM_MODE_OVERLAY_LANDED - intel_screen_private *intel = intel_get_screen_private(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); struct drm_i915_getparam gp; int has_overlay = 0; @@ -243,11 +243,11 @@ static Bool drmmode_has_overlay(ScrnInfoPtr pScrn) #endif } -static void drmmode_overlay_update_attrs(ScrnInfoPtr pScrn) +static void drmmode_overlay_update_attrs(ScrnInfoPtr scrn) { #ifdef DRM_MODE_OVERLAY_LANDED - intel_screen_private *intel = intel_get_screen_private(pScrn); - I830PortPrivPtr pPriv = GET_PORT_PRIVATE(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); + I830PortPrivPtr pPriv = GET_PORT_PRIVATE(scrn); struct drm_intel_overlay_attrs attrs; int ret; @@ -271,10 +271,10 @@ static void drmmode_overlay_update_attrs(ScrnInfoPtr pScrn) #endif } -static void drmmode_overlay_off(ScrnInfoPtr pScrn) +static void drmmode_overlay_off(ScrnInfoPtr scrn) { #ifdef DRM_MODE_OVERLAY_LANDED - intel_screen_private *intel = intel_get_screen_private(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); struct drm_intel_overlay_put_image request; int ret; @@ -289,15 +289,15 @@ static void drmmode_overlay_off(ScrnInfoPtr pScrn) } static Bool -drmmode_overlay_put_image(ScrnInfoPtr pScrn, xf86CrtcPtr crtc, +drmmode_overlay_put_image(ScrnInfoPtr scrn, xf86CrtcPtr crtc, int id, short width, short height, int dstPitch, int x1, int y1, int x2, int y2, BoxPtr dstBox, short src_w, short src_h, short drw_w, short drw_h) { #ifdef DRM_MODE_OVERLAY_LANDED - intel_screen_private *intel = intel_get_screen_private(pScrn); - I830PortPrivPtr pPriv = GET_PORT_PRIVATE(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); + I830PortPrivPtr pPriv = GET_PORT_PRIVATE(scrn); struct drm_intel_overlay_put_image request; int ret; int planar = is_planar_fourcc(id); @@ -368,8 +368,8 @@ drmmode_overlay_put_image(ScrnInfoPtr pScrn, xf86CrtcPtr crtc, void I830InitVideo(ScreenPtr pScreen) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; - intel_screen_private *intel = intel_get_screen_private(pScrn); + ScrnInfoPtr scrn = xf86Screens[pScreen->myNum]; + intel_screen_private *intel = intel_get_screen_private(scrn); XF86VideoAdaptorPtr *adaptors, *newAdaptors = NULL; XF86VideoAdaptorPtr overlayAdaptor = NULL, texturedAdaptor = NULL; int num_adaptors; @@ -377,7 +377,7 @@ void I830InitVideo(ScreenPtr pScreen) Bool xvmc_status = FALSE; #endif - num_adaptors = xf86XVListGenericAdaptors(pScrn, &adaptors); + num_adaptors = xf86XVListGenericAdaptors(scrn, &adaptors); /* Give our adaptor list enough space for the overlay and/or texture video * adaptors. */ @@ -399,28 +399,28 @@ void I830InitVideo(ScreenPtr pScreen) /* Set up textured video if we can do it at this depth and we are on * supported hardware. */ - if (pScrn->bitsPerPixel >= 16 && (IS_I9XX(intel) || IS_I965G(intel)) && - !(!IS_I965G(intel) && pScrn->displayWidth > 2048)) { + if (scrn->bitsPerPixel >= 16 && (IS_I9XX(intel) || IS_I965G(intel)) && + !(!IS_I965G(intel) && scrn->displayWidth > 2048)) { texturedAdaptor = I830SetupImageVideoTextured(pScreen); if (texturedAdaptor != NULL) { - xf86DrvMsg(pScrn->scrnIndex, X_INFO, + xf86DrvMsg(scrn->scrnIndex, X_INFO, "Set up textured video\n"); } else { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + xf86DrvMsg(scrn->scrnIndex, X_ERROR, "Failed to set up textured video\n"); } } /* Set up overlay video if we can do it at this depth. */ - if (!OVERLAY_NOEXIST(intel) && pScrn->bitsPerPixel != 8) { - intel->use_drmmode_overlay = drmmode_has_overlay(pScrn); + if (!OVERLAY_NOEXIST(intel) && scrn->bitsPerPixel != 8) { + intel->use_drmmode_overlay = drmmode_has_overlay(scrn); if (intel->use_drmmode_overlay) { overlayAdaptor = I830SetupImageVideoOverlay(pScreen); if (overlayAdaptor != NULL) { - xf86DrvMsg(pScrn->scrnIndex, X_INFO, + xf86DrvMsg(scrn->scrnIndex, X_INFO, "Set up overlay video\n"); } else { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + xf86DrvMsg(scrn->scrnIndex, X_ERROR, "Failed to set up overlay video\n"); } } @@ -436,7 +436,7 @@ void I830InitVideo(ScreenPtr pScreen) adaptors[num_adaptors++] = overlayAdaptor; #ifdef INTEL_XVMC - if (intel_xvmc_probe(pScrn)) { + if (intel_xvmc_probe(scrn)) { if (texturedAdaptor) xvmc_status = intel_xvmc_driver_init(pScreen, texturedAdaptor); @@ -446,7 +446,7 @@ void I830InitVideo(ScreenPtr pScreen) if (num_adaptors) { xf86XVScreenInit(pScreen, adaptors, num_adaptors); } else { - xf86DrvMsg(pScrn->scrnIndex, X_WARNING, + xf86DrvMsg(scrn->scrnIndex, X_WARNING, "Disabling Xv because no adaptors could be initialized.\n"); intel->XvEnabled = FALSE; } @@ -466,8 +466,8 @@ void I830InitVideo(ScreenPtr pScreen) static XF86VideoAdaptorPtr I830SetupImageVideoOverlay(ScreenPtr pScreen) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; - intel_screen_private *intel = intel_get_screen_private(pScrn); + ScrnInfoPtr scrn = xf86Screens[pScreen->myNum]; + intel_screen_private *intel = intel_get_screen_private(scrn); XF86VideoAdaptorPtr adapt; I830PortPrivPtr pPriv; XF86AttributePtr att; @@ -529,7 +529,7 @@ static XF86VideoAdaptorPtr I830SetupImageVideoOverlay(ScreenPtr pScreen) adapt->QueryImageAttributes = I830QueryImageAttributes; pPriv->textured = FALSE; - pPriv->colorKey = intel->colorKey & ((1 << pScrn->depth) - 1); + pPriv->colorKey = intel->colorKey & ((1 << scrn->depth) - 1); pPriv->videoStatus = 0; pPriv->brightness = -19; /* (255/219) * -16 */ pPriv->contrast = 75; /* 255/219 * 64 */ @@ -583,7 +583,7 @@ static XF86VideoAdaptorPtr I830SetupImageVideoOverlay(ScreenPtr pScreen) xvGamma5 = MAKE_ATOM("XV_GAMMA5"); } - drmmode_overlay_update_attrs(pScrn); + drmmode_overlay_update_attrs(scrn); return adapt; } @@ -679,7 +679,7 @@ static void i830_free_video_buffers(I830PortPrivPtr pPriv) } } -static void I830StopVideo(ScrnInfoPtr pScrn, pointer data, Bool shutdown) +static void I830StopVideo(ScrnInfoPtr scrn, pointer data, Bool shutdown) { I830PortPrivPtr pPriv = (I830PortPrivPtr) data; @@ -688,11 +688,11 @@ static void I830StopVideo(ScrnInfoPtr pScrn, pointer data, Bool shutdown) OVERLAY_DEBUG("I830StopVideo\n"); - REGION_EMPTY(pScrn->pScreen, &pPriv->clip); + REGION_EMPTY(scrn->pScreen, &pPriv->clip); if (shutdown) { if (pPriv->videoStatus & CLIENT_VIDEO_ON) - drmmode_overlay_off(pScrn); + drmmode_overlay_off(scrn); i830_free_video_buffers(pPriv); pPriv->videoStatus = 0; @@ -706,7 +706,7 @@ static void I830StopVideo(ScrnInfoPtr pScrn, pointer data, Bool shutdown) } static int -I830SetPortAttributeTextured(ScrnInfoPtr pScrn, +I830SetPortAttributeTextured(ScrnInfoPtr scrn, Atom attribute, INT32 value, pointer data) { I830PortPrivPtr pPriv = (I830PortPrivPtr) data; @@ -732,11 +732,11 @@ I830SetPortAttributeTextured(ScrnInfoPtr pScrn, } static int -I830SetPortAttributeOverlay(ScrnInfoPtr pScrn, +I830SetPortAttributeOverlay(ScrnInfoPtr scrn, Atom attribute, INT32 value, pointer data) { I830PortPrivPtr pPriv = (I830PortPrivPtr) data; - intel_screen_private *intel = intel_get_screen_private(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); if (attribute == xvBrightness) { if ((value < -128) || (value > 127)) @@ -753,7 +753,7 @@ I830SetPortAttributeOverlay(ScrnInfoPtr pScrn, return BadValue; pPriv->saturation = value; } else if (attribute == xvPipe) { - xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); if ((value < -1) || (value > xf86_config->num_crtc)) return BadValue; if (value < 0) @@ -791,19 +791,19 @@ I830SetPortAttributeOverlay(ScrnInfoPtr pScrn, OVERLAY_DEBUG("GAMMA\n"); } - drmmode_overlay_update_attrs(pScrn); + drmmode_overlay_update_attrs(scrn); if (attribute == xvColorKey) - REGION_EMPTY(pScrn->pScreen, &pPriv->clip); + REGION_EMPTY(scrn->pScreen, &pPriv->clip); return Success; } static int -I830GetPortAttribute(ScrnInfoPtr pScrn, +I830GetPortAttribute(ScrnInfoPtr scrn, Atom attribute, INT32 * value, pointer data) { - intel_screen_private *intel = intel_get_screen_private(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); I830PortPrivPtr pPriv = (I830PortPrivPtr) data; if (attribute == xvBrightness) { @@ -814,7 +814,7 @@ I830GetPortAttribute(ScrnInfoPtr pScrn, *value = pPriv->saturation; } else if (attribute == xvPipe) { int c; - xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); for (c = 0; c < xf86_config->num_crtc; c++) if (xf86_config->crtc[c] == pPriv->desired_crtc) break; @@ -844,7 +844,7 @@ I830GetPortAttribute(ScrnInfoPtr pScrn, } static void -I830QueryBestSize(ScrnInfoPtr pScrn, +I830QueryBestSize(ScrnInfoPtr scrn, Bool motion, short vid_w, short vid_h, short drw_w, short drw_h, @@ -1130,10 +1130,10 @@ static int i830_box_area(BoxPtr box) */ xf86CrtcPtr -i830_covering_crtc(ScrnInfoPtr pScrn, +i830_covering_crtc(ScrnInfoPtr scrn, BoxPtr box, xf86CrtcPtr desired, BoxPtr crtc_box_ret) { - xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); xf86CrtcPtr crtc, best_crtc; int coverage, best_coverage; int c; @@ -1169,7 +1169,7 @@ i830_covering_crtc(ScrnInfoPtr pScrn, } static void -i830_update_dst_box_to_crtc_coords(ScrnInfoPtr pScrn, xf86CrtcPtr crtc, +i830_update_dst_box_to_crtc_coords(ScrnInfoPtr scrn, xf86CrtcPtr crtc, BoxPtr dstBox) { int tmp; @@ -1188,28 +1188,28 @@ i830_update_dst_box_to_crtc_coords(ScrnInfoPtr pScrn, xf86CrtcPtr crtc, case RR_Rotate_90: tmp = dstBox->x1; dstBox->x1 = dstBox->y1 - crtc->x; - dstBox->y1 = pScrn->virtualX - tmp - crtc->y; + dstBox->y1 = scrn->virtualX - tmp - crtc->y; tmp = dstBox->x2; dstBox->x2 = dstBox->y2 - crtc->x; - dstBox->y2 = pScrn->virtualX - tmp - crtc->y; + dstBox->y2 = scrn->virtualX - tmp - crtc->y; tmp = dstBox->y1; dstBox->y1 = dstBox->y2; dstBox->y2 = tmp; break; case RR_Rotate_180: tmp = dstBox->x1; - dstBox->x1 = pScrn->virtualX - dstBox->x2 - crtc->x; - dstBox->x2 = pScrn->virtualX - tmp - crtc->x; + dstBox->x1 = scrn->virtualX - dstBox->x2 - crtc->x; + dstBox->x2 = scrn->virtualX - tmp - crtc->x; tmp = dstBox->y1; - dstBox->y1 = pScrn->virtualY - dstBox->y2 - crtc->y; - dstBox->y2 = pScrn->virtualY - tmp - crtc->y; + dstBox->y1 = scrn->virtualY - dstBox->y2 - crtc->y; + dstBox->y2 = scrn->virtualY - tmp - crtc->y; break; case RR_Rotate_270: tmp = dstBox->x1; - dstBox->x1 = pScrn->virtualY - dstBox->y1 - crtc->x; + dstBox->x1 = scrn->virtualY - dstBox->y1 - crtc->x; dstBox->y1 = tmp - crtc->y; tmp = dstBox->x2; - dstBox->x2 = pScrn->virtualY - dstBox->y2 - crtc->x; + dstBox->x2 = scrn->virtualY - dstBox->y2 - crtc->x; dstBox->y2 = tmp - crtc->y; tmp = dstBox->x1; dstBox->x1 = dstBox->x2; @@ -1248,13 +1248,13 @@ static int xvmc_passthrough(int id, Rotation rotation) } static Bool -i830_display_overlay(ScrnInfoPtr pScrn, xf86CrtcPtr crtc, +i830_display_overlay(ScrnInfoPtr scrn, xf86CrtcPtr crtc, int id, short width, short height, int dstPitch, int x1, int y1, int x2, int y2, BoxPtr dstBox, short src_w, short src_h, short drw_w, short drw_h) { - intel_screen_private *intel = intel_get_screen_private(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); I830PortPrivPtr pPriv = intel->adaptor->pPortPrivates[0].ptr; int tmp; @@ -1270,12 +1270,12 @@ i830_display_overlay(ScrnInfoPtr pScrn, xf86CrtcPtr crtc, */ if (!crtc) { pPriv->current_crtc = NULL; - drmmode_overlay_off(pScrn); + drmmode_overlay_off(scrn); return TRUE; } - i830_update_dst_box_to_crtc_coords(pScrn, crtc, dstBox); + i830_update_dst_box_to_crtc_coords(scrn, crtc, dstBox); if (crtc->rotation & (RR_Rotate_90 | RR_Rotate_270)) { tmp = width; @@ -1289,13 +1289,13 @@ i830_display_overlay(ScrnInfoPtr pScrn, xf86CrtcPtr crtc, src_h = tmp; } - return drmmode_overlay_put_image(pScrn, crtc, id, width, height, + return drmmode_overlay_put_image(scrn, crtc, id, width, height, dstPitch, x1, y1, x2, y2, dstBox, src_w, src_h, drw_w, drw_h); } static Bool -i830_clip_video_helper(ScrnInfoPtr pScrn, +i830_clip_video_helper(ScrnInfoPtr scrn, I830PortPrivPtr pPriv, xf86CrtcPtr * crtc_ret, BoxPtr dst, @@ -1314,7 +1314,7 @@ i830_clip_video_helper(ScrnInfoPtr pScrn, */ if (crtc_ret) { BoxRec crtc_box; - xf86CrtcPtr crtc = i830_covering_crtc(pScrn, dst, + xf86CrtcPtr crtc = i830_covering_crtc(scrn, dst, pPriv->desired_crtc, &crtc_box); @@ -1369,10 +1369,10 @@ i830_fill_colorkey(ScreenPtr pScreen, uint32_t key, RegionPtr clipboxes) } static void -i830_wait_for_scanline(ScrnInfoPtr pScrn, PixmapPtr pPixmap, +i830_wait_for_scanline(ScrnInfoPtr scrn, PixmapPtr pPixmap, xf86CrtcPtr crtc, RegionPtr clipBoxes) { - intel_screen_private *intel = intel_get_screen_private(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); BoxPtr box; pixman_box16_t box_in_crtc_coordinates; int pipe = -1, event, load_scan_lines_pipe; @@ -1410,10 +1410,10 @@ i830_wait_for_scanline(ScrnInfoPtr pScrn, PixmapPtr pPixmap, } static Bool -i830_setup_video_buffer(ScrnInfoPtr pScrn, I830PortPrivPtr pPriv, +i830_setup_video_buffer(ScrnInfoPtr scrn, I830PortPrivPtr pPriv, int alloc_size, int id) { - intel_screen_private *intel = intel_get_screen_private(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); /* Free the current buffer if we're going to have to reallocate */ if (pPriv->buf && pPriv->buf->size < alloc_size) { drm_intel_bo_unreference(pPriv->buf); @@ -1436,11 +1436,11 @@ i830_setup_video_buffer(ScrnInfoPtr pScrn, I830PortPrivPtr pPriv, } static void -i830_dst_pitch_and_size(ScrnInfoPtr pScrn, I830PortPrivPtr pPriv, short width, +i830_dst_pitch_and_size(ScrnInfoPtr scrn, I830PortPrivPtr pPriv, short width, short height, int *dstPitch, int *dstPitch2, int *size, int id) { - intel_screen_private *intel = intel_get_screen_private(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); int pitchAlignMask; /* Only needs to be DWORD-aligned for textured on i915, but overlay has @@ -1508,12 +1508,12 @@ i830_dst_pitch_and_size(ScrnInfoPtr pScrn, I830PortPrivPtr pPriv, short width, } static Bool -i830_copy_video_data(ScrnInfoPtr pScrn, I830PortPrivPtr pPriv, +i830_copy_video_data(ScrnInfoPtr scrn, I830PortPrivPtr pPriv, short width, short height, int *dstPitch, int *dstPitch2, INT32 x1, INT32 y1, INT32 x2, INT32 y2, int id, unsigned char *buf) { - intel_screen_private *intel = intel_get_screen_private(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); int srcPitch = 0, srcPitch2 = 0; int top, left, npixels, nlines, size; @@ -1524,10 +1524,10 @@ i830_copy_video_data(ScrnInfoPtr pScrn, I830PortPrivPtr pPriv, srcPitch = width << 1; } - i830_dst_pitch_and_size(pScrn, pPriv, width, height, dstPitch, + i830_dst_pitch_and_size(scrn, pPriv, width, height, dstPitch, dstPitch2, &size, id); - if (!i830_setup_video_buffer(pScrn, pPriv, size, id)) + if (!i830_setup_video_buffer(scrn, pPriv, size, id)) return FALSE; /* fixup pointers */ @@ -1592,7 +1592,7 @@ i830_copy_video_data(ScrnInfoPtr pScrn, I830PortPrivPtr pPriv, * compositing. It's a new argument to the function in the 1.1 server. */ static int -I830PutImage(ScrnInfoPtr pScrn, +I830PutImage(ScrnInfoPtr scrn, short src_x, short src_y, short drw_x, short drw_y, short src_w, short src_h, @@ -1601,9 +1601,9 @@ I830PutImage(ScrnInfoPtr pScrn, short width, short height, Bool sync, RegionPtr clipBoxes, pointer data, DrawablePtr pDraw) { - intel_screen_private *intel = intel_get_screen_private(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); I830PortPrivPtr pPriv = (I830PortPrivPtr) data; - ScreenPtr pScreen = screenInfo.screens[pScrn->scrnIndex]; + ScreenPtr pScreen = screenInfo.screens[scrn->scrnIndex]; PixmapPtr pPixmap = get_drawable_pixmap(pDraw);; INT32 x1, x2, y1, y2; int dstPitch; @@ -1639,7 +1639,7 @@ I830PutImage(ScrnInfoPtr pScrn, dstBox.y1 = drw_y; dstBox.y2 = drw_y + drw_h; - if (!i830_clip_video_helper(pScrn, + if (!i830_clip_video_helper(scrn, pPriv, &crtc, &dstBox, &x1, &x2, &y1, &y2, clipBoxes, @@ -1651,31 +1651,31 @@ I830PutImage(ScrnInfoPtr pScrn, if (crtc) pPriv->rotation = crtc->rotation; else { - xf86DrvMsg(pScrn->scrnIndex, X_WARNING, + xf86DrvMsg(scrn->scrnIndex, X_WARNING, "Fail to clip video to any crtc!\n"); return Success; } } - if (!i830_copy_video_data(pScrn, pPriv, width, height, + if (!i830_copy_video_data(scrn, pPriv, width, height, &dstPitch, &dstPitch2, x1, y1, x2, y2, id, buf)) return BadAlloc; if (!pPriv->textured) { if (!i830_display_overlay - (pScrn, crtc, id, width, height, dstPitch, x1, y1, x2, y2, + (scrn, crtc, id, width, height, dstPitch, x1, y1, x2, y2, &dstBox, src_w, src_h, drw_w, drw_h)) return BadAlloc; /* update cliplist */ - if (!REGION_EQUAL(pScrn->pScreen, &pPriv->clip, clipBoxes)) { - REGION_COPY(pScrn->pScreen, &pPriv->clip, clipBoxes); + if (!REGION_EQUAL(scrn->pScreen, &pPriv->clip, clipBoxes)) { + REGION_COPY(scrn->pScreen, &pPriv->clip, clipBoxes); i830_fill_colorkey(pScreen, pPriv->colorKey, clipBoxes); } } else { if (crtc && pPriv->SyncToVblank != 0) { - i830_wait_for_scanline(pScrn, pPixmap, crtc, clipBoxes); + i830_wait_for_scanline(scrn, pPixmap, crtc, clipBoxes); } if (IS_I965G(intel)) { @@ -1687,12 +1687,12 @@ I830PutImage(ScrnInfoPtr pScrn, pPriv->VBufOffset = pPriv->UBufOffset + height * width / 4; } - I965DisplayVideoTextured(pScrn, pPriv, id, clipBoxes, + I965DisplayVideoTextured(scrn, pPriv, id, clipBoxes, width, height, dstPitch, x1, y1, x2, y2, src_w, src_h, drw_w, drw_h, pPixmap); } else { - I915DisplayVideoTextured(pScrn, pPriv, id, clipBoxes, + I915DisplayVideoTextured(scrn, pPriv, id, clipBoxes, width, height, dstPitch, dstPitch2, x1, y1, x2, y2, src_w, src_h, drw_w, drw_h, @@ -1708,12 +1708,12 @@ I830PutImage(ScrnInfoPtr pScrn, } static int -I830QueryImageAttributes(ScrnInfoPtr pScrn, +I830QueryImageAttributes(ScrnInfoPtr scrn, int id, unsigned short *w, unsigned short *h, int *pitches, int *offsets) { - intel_screen_private *intel = intel_get_screen_private(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); int size, tmp; #if 0 @@ -1797,15 +1797,15 @@ void I830VideoBlockHandler(int i, pointer blockData, pointer pTimeout, pointer pReadmask) { - ScrnInfoPtr pScrn = xf86Screens[i]; - intel_screen_private *intel = intel_get_screen_private(pScrn); + ScrnInfoPtr scrn = xf86Screens[i]; + intel_screen_private *intel = intel_get_screen_private(scrn); I830PortPrivPtr pPriv; /* no overlay */ if (intel->adaptor == NULL) return; - pPriv = GET_PORT_PRIVATE(pScrn); + pPriv = GET_PORT_PRIVATE(scrn); if (pPriv->videoStatus & TIMER_MASK) { #if 1 @@ -1818,7 +1818,7 @@ I830VideoBlockHandler(int i, pointer blockData, pointer pTimeout, /* Turn off the overlay */ OVERLAY_DEBUG("BLOCKHANDLER\n"); - drmmode_overlay_off(pScrn); + drmmode_overlay_off(scrn); pPriv->videoStatus = FREE_TIMER; pPriv->freeTime = now + FREE_DELAY; diff --git a/src/i830_video.h b/src/i830_video.h index 2905be3e..40aeb576 100644 --- a/src/i830_video.h +++ b/src/i830_video.h @@ -65,17 +65,17 @@ typedef struct { int SyncToVblank; /* -1: auto, 0: off, 1: on */ } I830PortPrivRec, *I830PortPrivPtr; -#define GET_PORT_PRIVATE(pScrn) \ - (I830PortPrivPtr)((intel_get_screen_private(pScrn))->adaptor->pPortPrivates[0].ptr) +#define GET_PORT_PRIVATE(scrn) \ + (I830PortPrivPtr)((intel_get_screen_private(scrn))->adaptor->pPortPrivates[0].ptr) -void I915DisplayVideoTextured(ScrnInfoPtr pScrn, I830PortPrivPtr pPriv, +void I915DisplayVideoTextured(ScrnInfoPtr scrn, I830PortPrivPtr pPriv, int id, RegionPtr dstRegion, short width, short height, int video_pitch, int video_pitch2, int x1, int y1, int x2, int y2, short src_w, short src_h, short drw_w, short drw_h, PixmapPtr pPixmap); -void I965DisplayVideoTextured(ScrnInfoPtr pScrn, I830PortPrivPtr pPriv, +void I965DisplayVideoTextured(ScrnInfoPtr scrn, I830PortPrivPtr pPriv, int id, RegionPtr dstRegion, short width, short height, int video_pitch, int x1, int y1, int x2, int y2, diff --git a/src/i915_3d.c b/src/i915_3d.c index 053a94f4..e3b56741 100644 --- a/src/i915_3d.c +++ b/src/i915_3d.c @@ -34,9 +34,9 @@ #include "i915_reg.h" -void I915EmitInvarientState(ScrnInfoPtr pScrn) +void I915EmitInvarientState(ScrnInfoPtr scrn) { - intel_screen_private *intel = intel_get_screen_private(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); BEGIN_BATCH(24); diff --git a/src/i915_hwmc.c b/src/i915_hwmc.c index 1c1acedb..e1a45b50 100644 --- a/src/i915_hwmc.c +++ b/src/i915_hwmc.c @@ -207,17 +207,17 @@ static void cleanupI915XvMC(I915XvMCPtr xvmc) } } -static Bool i915_map_xvmc_buffers(ScrnInfoPtr pScrn, +static Bool i915_map_xvmc_buffers(ScrnInfoPtr scrn, I915XvMCContextPriv * ctxpriv) { - intel_screen_private *intel = intel_get_screen_private(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); if (drmAddMap(intel->drmSubFD, (drm_handle_t) (ctxpriv->mcStaticIndirectState->offset + intel->LinearAddr), ctxpriv->mcStaticIndirectState->size, DRM_AGP, 0, (drmAddress) & ctxpriv->sis_handle) < 0) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + xf86DrvMsg(scrn->scrnIndex, X_ERROR, "[drm] drmAddMap(sis_handle) failed!\n"); return FALSE; } @@ -227,7 +227,7 @@ static Bool i915_map_xvmc_buffers(ScrnInfoPtr pScrn, intel->LinearAddr), ctxpriv->mcSamplerState->size, DRM_AGP, 0, (drmAddress) & ctxpriv->ssb_handle) < 0) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + xf86DrvMsg(scrn->scrnIndex, X_ERROR, "[drm] drmAddMap(ssb_handle) failed!\n"); return FALSE; } @@ -237,7 +237,7 @@ static Bool i915_map_xvmc_buffers(ScrnInfoPtr pScrn, intel->LinearAddr), ctxpriv->mcMapState->size, DRM_AGP, 0, (drmAddress) & ctxpriv->msb_handle) < 0) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + xf86DrvMsg(scrn->scrnIndex, X_ERROR, "[drm] drmAddMap(msb_handle) failed!\n"); return FALSE; } @@ -247,7 +247,7 @@ static Bool i915_map_xvmc_buffers(ScrnInfoPtr pScrn, intel->LinearAddr), ctxpriv->mcPixelShaderProgram->size, DRM_AGP, 0, (drmAddress) & ctxpriv->psp_handle) < 0) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + xf86DrvMsg(scrn->scrnIndex, X_ERROR, "[drm] drmAddMap(psp_handle) failed!\n"); return FALSE; } @@ -257,7 +257,7 @@ static Bool i915_map_xvmc_buffers(ScrnInfoPtr pScrn, intel->LinearAddr), ctxpriv->mcPixelShaderConstants->size, DRM_AGP, 0, (drmAddress) & ctxpriv->psc_handle) < 0) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + xf86DrvMsg(scrn->scrnIndex, X_ERROR, "[drm] drmAddMap(psc_handle) failed!\n"); return FALSE; } @@ -267,7 +267,7 @@ static Bool i915_map_xvmc_buffers(ScrnInfoPtr pScrn, intel->LinearAddr), ctxpriv->mcCorrdata->size, DRM_AGP, 0, (drmAddress) & ctxpriv->corrdata_handle) < 0) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + xf86DrvMsg(scrn->scrnIndex, X_ERROR, "[drm] drmAddMap(corrdata_handle) failed!\n"); return FALSE; } @@ -275,10 +275,10 @@ static Bool i915_map_xvmc_buffers(ScrnInfoPtr pScrn, return TRUE; } -static void i915_unmap_xvmc_buffers(ScrnInfoPtr pScrn, +static void i915_unmap_xvmc_buffers(ScrnInfoPtr scrn, I915XvMCContextPriv * ctxpriv) { - intel_screen_private *intel = intel_get_screen_private(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); if (ctxpriv->sis_handle) { drmRmMap(intel->drmSubFD, ctxpriv->sis_handle); @@ -312,88 +312,88 @@ static void i915_unmap_xvmc_buffers(ScrnInfoPtr pScrn, } -static Bool i915_allocate_xvmc_buffers(ScrnInfoPtr pScrn, +static Bool i915_allocate_xvmc_buffers(ScrnInfoPtr scrn, I915XvMCContextPriv * ctxpriv) { - intel_screen_private *intel = intel_get_screen_private(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); int flags = ALIGN_BOTH_ENDS; /* on 915G/GM, load indirect can only use physical address...sigh */ if (IS_I915G(intel) || IS_I915GM(intel)) flags |= NEED_PHYSICAL_ADDR; - if (!i830_allocate_xvmc_buffer(pScrn, "[XvMC]Static Indirect State", + if (!i830_allocate_xvmc_buffer(scrn, "[XvMC]Static Indirect State", &(ctxpriv->mcStaticIndirectState), 4 * 1024, flags)) { return FALSE; } - if (!i830_allocate_xvmc_buffer(pScrn, "[XvMC]Sampler State", + if (!i830_allocate_xvmc_buffer(scrn, "[XvMC]Sampler State", &(ctxpriv->mcSamplerState), 4 * 1024, flags)) { return FALSE; } - if (!i830_allocate_xvmc_buffer(pScrn, "[XvMC]Map State", + if (!i830_allocate_xvmc_buffer(scrn, "[XvMC]Map State", &(ctxpriv->mcMapState), 4 * 1024, flags)) { return FALSE; } - if (!i830_allocate_xvmc_buffer(pScrn, "[XvMC]Pixel Shader Program", + if (!i830_allocate_xvmc_buffer(scrn, "[XvMC]Pixel Shader Program", &(ctxpriv->mcPixelShaderProgram), 4 * 1024, flags)) { return FALSE; } - if (!i830_allocate_xvmc_buffer(pScrn, "[XvMC]Pixel Shader Constants", + if (!i830_allocate_xvmc_buffer(scrn, "[XvMC]Pixel Shader Constants", &(ctxpriv->mcPixelShaderConstants), 4 * 1024, flags)) { return FALSE; } - if (!i830_allocate_xvmc_buffer(pScrn, "[XvMC]Correction Data Buffer", + if (!i830_allocate_xvmc_buffer(scrn, "[XvMC]Correction Data Buffer", &(ctxpriv->mcCorrdata), 512 * 1024, ALIGN_BOTH_ENDS)) { return FALSE; } if (1) - i830_describe_allocations(pScrn, 1, "i915_mc: "); + i830_describe_allocations(scrn, 1, "i915_mc: "); return TRUE; } -static void i915_free_xvmc_buffers(ScrnInfoPtr pScrn, +static void i915_free_xvmc_buffers(ScrnInfoPtr scrn, I915XvMCContextPriv * ctxpriv) { if (ctxpriv->mcStaticIndirectState) { - i830_free_xvmc_buffer(pScrn, ctxpriv->mcStaticIndirectState); + i830_free_xvmc_buffer(scrn, ctxpriv->mcStaticIndirectState); ctxpriv->mcStaticIndirectState = NULL; } if (ctxpriv->mcSamplerState) { - i830_free_xvmc_buffer(pScrn, ctxpriv->mcSamplerState); + i830_free_xvmc_buffer(scrn, ctxpriv->mcSamplerState); ctxpriv->mcSamplerState = NULL; } if (ctxpriv->mcMapState) { - i830_free_xvmc_buffer(pScrn, ctxpriv->mcMapState); + i830_free_xvmc_buffer(scrn, ctxpriv->mcMapState); ctxpriv->mcMapState = NULL; } if (ctxpriv->mcPixelShaderProgram) { - i830_free_xvmc_buffer(pScrn, ctxpriv->mcPixelShaderProgram); + i830_free_xvmc_buffer(scrn, ctxpriv->mcPixelShaderProgram); ctxpriv->mcPixelShaderProgram = NULL; } if (ctxpriv->mcPixelShaderConstants) { - i830_free_xvmc_buffer(pScrn, ctxpriv->mcPixelShaderConstants); + i830_free_xvmc_buffer(scrn, ctxpriv->mcPixelShaderConstants); ctxpriv->mcPixelShaderConstants = NULL; } if (ctxpriv->mcCorrdata) { - i830_free_xvmc_buffer(pScrn, ctxpriv->mcCorrdata); + i830_free_xvmc_buffer(scrn, ctxpriv->mcCorrdata); ctxpriv->mcCorrdata = NULL; } @@ -412,10 +412,10 @@ static void i915_free_xvmc_buffers(ScrnInfoPtr pScrn, * **************************************************************************/ -static int i915_xvmc_create_context(ScrnInfoPtr pScrn, XvMCContextPtr pContext, +static int i915_xvmc_create_context(ScrnInfoPtr scrn, XvMCContextPtr pContext, int *num_priv, long **priv) { - intel_screen_private *intel = intel_get_screen_private(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); I915XvMCCreateContextRec *contextRec = NULL; I915XvMCPtr pXvMC = (I915XvMCPtr) xvmc_driver->devPrivate; I915XvMCContextPriv *ctxpriv = NULL; @@ -425,7 +425,7 @@ static int i915_xvmc_create_context(ScrnInfoPtr pScrn, XvMCContextPtr pContext, *num_priv = 0; if (!intel->XvMCEnabled) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + xf86DrvMsg(scrn->scrnIndex, X_ERROR, "[XvMC] i915: XvMC disabled!\n"); return BadAlloc; } @@ -437,7 +437,7 @@ static int i915_xvmc_create_context(ScrnInfoPtr pScrn, XvMCContextPtr pContext, if (i == I915_XVMC_MAX_CONTEXTS || pXvMC->ncontexts >= I915_XVMC_MAX_CONTEXTS) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + xf86DrvMsg(scrn->scrnIndex, X_ERROR, "[XvMC] i915: Out of contexts.\n"); return BadAlloc; } @@ -458,7 +458,7 @@ static int i915_xvmc_create_context(ScrnInfoPtr pScrn, XvMCContextPtr pContext, (I915XvMCContextPriv *) xcalloc(1, sizeof(I915XvMCContextPriv)); if (!ctxpriv) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + xf86DrvMsg(scrn->scrnIndex, X_ERROR, "[XvMC] i915: Unable to allocate memory!\n"); xfree(*priv); *priv = NULL; @@ -466,8 +466,8 @@ static int i915_xvmc_create_context(ScrnInfoPtr pScrn, XvMCContextPtr pContext, return BadAlloc; } - if (!i915_allocate_xvmc_buffers(pScrn, ctxpriv)) { - i915_free_xvmc_buffers(pScrn, ctxpriv); + if (!i915_allocate_xvmc_buffers(scrn, ctxpriv)) { + i915_free_xvmc_buffers(scrn, ctxpriv); xfree(ctxpriv); ctxpriv = NULL; xfree(*priv); @@ -476,9 +476,9 @@ static int i915_xvmc_create_context(ScrnInfoPtr pScrn, XvMCContextPtr pContext, return BadAlloc; } - if (!i915_map_xvmc_buffers(pScrn, ctxpriv)) { - i915_unmap_xvmc_buffers(pScrn, ctxpriv); - i915_free_xvmc_buffers(pScrn, ctxpriv); + if (!i915_map_xvmc_buffers(scrn, ctxpriv)) { + i915_unmap_xvmc_buffers(scrn, ctxpriv); + i915_free_xvmc_buffers(scrn, ctxpriv); xfree(ctxpriv); ctxpriv = NULL; xfree(*priv); @@ -536,10 +536,10 @@ static int i915_xvmc_create_context(ScrnInfoPtr pScrn, XvMCContextPtr pContext, return Success; } -static int i915_xvmc_create_surface(ScrnInfoPtr pScrn, XvMCSurfacePtr pSurf, +static int i915_xvmc_create_surface(ScrnInfoPtr scrn, XvMCSurfacePtr pSurf, int *num_priv, long **priv) { - intel_screen_private *intel = intel_get_screen_private(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); I915XvMCPtr pXvMC = (I915XvMCPtr) xvmc_driver->devPrivate; I915XvMCSurfacePriv *sfpriv = NULL; I915XvMCCreateSurfaceRec *surfaceRec = NULL; @@ -548,7 +548,7 @@ static int i915_xvmc_create_surface(ScrnInfoPtr pScrn, XvMCSurfacePtr pSurf, unsigned long bufsize; if (!intel->XvMCEnabled) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + xf86DrvMsg(scrn->scrnIndex, X_ERROR, "[XvMC] i915: XvMC disabled!\n"); return BadAlloc; } @@ -563,7 +563,7 @@ static int i915_xvmc_create_surface(ScrnInfoPtr pScrn, XvMCSurfacePtr pSurf, if (srfno == I915_XVMC_MAX_SURFACES || pXvMC->nsurfaces >= I915_XVMC_MAX_SURFACES) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + xf86DrvMsg(scrn->scrnIndex, X_ERROR, "[XvMC] i915: Too many surfaces !\n"); return BadAlloc; } @@ -572,7 +572,7 @@ static int i915_xvmc_create_surface(ScrnInfoPtr pScrn, XvMCSurfacePtr pSurf, surfaceRec = (I915XvMCCreateSurfaceRec *) * priv; if (!*priv) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + xf86DrvMsg(scrn->scrnIndex, X_ERROR, "[XvMC] i915:Unable to allocate surface priv ret memory!\n"); return BadAlloc; } @@ -582,7 +582,7 @@ static int i915_xvmc_create_surface(ScrnInfoPtr pScrn, XvMCSurfacePtr pSurf, (I915XvMCSurfacePriv *) xcalloc(1, sizeof(I915XvMCSurfacePriv)); if (!sfpriv) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + xf86DrvMsg(scrn->scrnIndex, X_ERROR, "[XvMC] i915: Unable to allocate surface priv memory!\n"); xfree(*priv); *priv = NULL; @@ -593,10 +593,10 @@ static int i915_xvmc_create_surface(ScrnInfoPtr pScrn, XvMCSurfacePtr pSurf, ctx = pSurf->context; bufsize = SIZE_YUV420(ctx->width, ctx->height); - if (!i830_allocate_xvmc_buffer(pScrn, "XvMC surface", + if (!i830_allocate_xvmc_buffer(scrn, "XvMC surface", &(sfpriv->surface), bufsize, ALIGN_BOTH_ENDS)) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + xf86DrvMsg(scrn->scrnIndex, X_ERROR, "[XvMC] i915 : Failed to allocate XvMC surface space!\n"); xfree(sfpriv); xfree(*priv); @@ -606,15 +606,15 @@ static int i915_xvmc_create_surface(ScrnInfoPtr pScrn, XvMCSurfacePtr pSurf, } if (0) - i830_describe_allocations(pScrn, 1, ""); + i830_describe_allocations(scrn, 1, ""); if (drmAddMap(intel->drmSubFD, (drm_handle_t) (sfpriv->surface->offset + intel->LinearAddr), sfpriv->surface->size, DRM_AGP, 0, (drmAddress) & sfpriv->surface_handle) < 0) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + xf86DrvMsg(scrn->scrnIndex, X_ERROR, "[drm] drmAddMap(surface_handle) failed!\n"); - i830_free_xvmc_buffer(pScrn, sfpriv->surface); + i830_free_xvmc_buffer(scrn, sfpriv->surface); xfree(sfpriv); xfree(*priv); *priv = NULL; @@ -634,10 +634,10 @@ static int i915_xvmc_create_surface(ScrnInfoPtr pScrn, XvMCSurfacePtr pSurf, return Success; } -static int i915_xvmc_create_subpict(ScrnInfoPtr pScrn, XvMCSubpicturePtr pSubp, +static int i915_xvmc_create_subpict(ScrnInfoPtr scrn, XvMCSubpicturePtr pSubp, int *num_priv, long **priv) { - intel_screen_private *intel = intel_get_screen_private(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); I915XvMCPtr pXvMC = (I915XvMCPtr) xvmc_driver->devPrivate; I915XvMCSurfacePriv *sfpriv = NULL; I915XvMCCreateSurfaceRec *surfaceRec = NULL; @@ -655,7 +655,7 @@ static int i915_xvmc_create_subpict(ScrnInfoPtr pScrn, XvMCSubpicturePtr pSubp, if (srfno == I915_XVMC_MAX_SURFACES || pXvMC->nsurfaces >= I915_XVMC_MAX_SURFACES) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + xf86DrvMsg(scrn->scrnIndex, X_ERROR, "[XvMC] i915: Too many surfaces !\n"); return BadAlloc; } @@ -664,7 +664,7 @@ static int i915_xvmc_create_subpict(ScrnInfoPtr pScrn, XvMCSubpicturePtr pSubp, surfaceRec = (I915XvMCCreateSurfaceRec *) * priv; if (!*priv) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + xf86DrvMsg(scrn->scrnIndex, X_ERROR, "[XvMC] i915: Unable to allocate memory!\n"); return BadAlloc; } @@ -674,7 +674,7 @@ static int i915_xvmc_create_subpict(ScrnInfoPtr pScrn, XvMCSubpicturePtr pSubp, (I915XvMCSurfacePriv *) xcalloc(1, sizeof(I915XvMCSurfacePriv)); if (!sfpriv) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + xf86DrvMsg(scrn->scrnIndex, X_ERROR, "[XvMC] i915: Unable to allocate memory!\n"); xfree(*priv); *priv = NULL; @@ -685,10 +685,10 @@ static int i915_xvmc_create_subpict(ScrnInfoPtr pScrn, XvMCSubpicturePtr pSubp, ctx = pSubp->context; bufsize = SIZE_XX44(ctx->width, ctx->height); - if (!i830_allocate_xvmc_buffer(pScrn, "XvMC surface", + if (!i830_allocate_xvmc_buffer(scrn, "XvMC surface", &(sfpriv->surface), bufsize, ALIGN_BOTH_ENDS)) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + xf86DrvMsg(scrn->scrnIndex, X_ERROR, "[XvMC] I915XvMCCreateSurface: Failed to allocate XvMC surface space!\n"); xfree(sfpriv); xfree(*priv); @@ -701,9 +701,9 @@ static int i915_xvmc_create_subpict(ScrnInfoPtr pScrn, XvMCSubpicturePtr pSubp, (drm_handle_t) (sfpriv->surface->offset + intel->LinearAddr), sfpriv->surface->size, DRM_AGP, 0, (drmAddress) & sfpriv->surface_handle) < 0) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + xf86DrvMsg(scrn->scrnIndex, X_ERROR, "[drm] drmAddMap(surface_handle) failed!\n"); - i830_free_xvmc_buffer(pScrn, sfpriv->surface); + i830_free_xvmc_buffer(scrn, sfpriv->surface); xfree(sfpriv); xfree(*priv); *priv = NULL; @@ -723,7 +723,7 @@ static int i915_xvmc_create_subpict(ScrnInfoPtr pScrn, XvMCSubpicturePtr pSubp, return Success; } -static void i915_xvmc_destroy_context(ScrnInfoPtr pScrn, +static void i915_xvmc_destroy_context(ScrnInfoPtr scrn, XvMCContextPtr pContext) { I915XvMCPtr pXvMC = (I915XvMCPtr) xvmc_driver->devPrivate; @@ -731,8 +731,8 @@ static void i915_xvmc_destroy_context(ScrnInfoPtr pScrn, for (i = 0; i < I915_XVMC_MAX_CONTEXTS; i++) { if (pXvMC->contexts[i] == pContext->context_id) { - i915_unmap_xvmc_buffers(pScrn, pXvMC->ctxprivs[i]); - i915_free_xvmc_buffers(pScrn, pXvMC->ctxprivs[i]); + i915_unmap_xvmc_buffers(scrn, pXvMC->ctxprivs[i]); + i915_free_xvmc_buffers(scrn, pXvMC->ctxprivs[i]); xfree(pXvMC->ctxprivs[i]); pXvMC->ctxprivs[i] = 0; pXvMC->ncontexts--; @@ -744,9 +744,9 @@ static void i915_xvmc_destroy_context(ScrnInfoPtr pScrn, return; } -static void i915_xvmc_destroy_surface(ScrnInfoPtr pScrn, XvMCSurfacePtr pSurf) +static void i915_xvmc_destroy_surface(ScrnInfoPtr scrn, XvMCSurfacePtr pSurf) { - intel_screen_private *intel = intel_get_screen_private(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); I915XvMCPtr pXvMC = (I915XvMCPtr) xvmc_driver->devPrivate; int i; @@ -754,7 +754,7 @@ static void i915_xvmc_destroy_surface(ScrnInfoPtr pScrn, XvMCSurfacePtr pSurf) if (pXvMC->surfaces[i] == pSurf->surface_id) { drmRmMap(intel->drmSubFD, pXvMC->sfprivs[i]->surface_handle); - i830_free_xvmc_buffer(pScrn, + i830_free_xvmc_buffer(scrn, pXvMC->sfprivs[i]->surface); xfree(pXvMC->sfprivs[i]); pXvMC->nsurfaces--; @@ -767,10 +767,10 @@ static void i915_xvmc_destroy_surface(ScrnInfoPtr pScrn, XvMCSurfacePtr pSurf) return; } -static void i915_xvmc_destroy_subpict(ScrnInfoPtr pScrn, +static void i915_xvmc_destroy_subpict(ScrnInfoPtr scrn, XvMCSubpicturePtr pSubp) { - intel_screen_private *intel = intel_get_screen_private(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); I915XvMCPtr pXvMC = (I915XvMCPtr) xvmc_driver->devPrivate; int i; @@ -778,7 +778,7 @@ static void i915_xvmc_destroy_subpict(ScrnInfoPtr pScrn, if (pXvMC->surfaces[i] == pSubp->subpicture_id) { drmRmMap(intel->drmSubFD, pXvMC->sfprivs[i]->surface_handle); - i830_free_xvmc_buffer(pScrn, + i830_free_xvmc_buffer(scrn, pXvMC->sfprivs[i]->surface); xfree(pXvMC->sfprivs[i]); pXvMC->nsurfaces--; @@ -791,7 +791,7 @@ static void i915_xvmc_destroy_subpict(ScrnInfoPtr pScrn, return; } -static int i915_xvmc_put_image(ScrnInfoPtr pScrn, +static int i915_xvmc_put_image(ScrnInfoPtr scrn, short src_x, short src_y, short drw_x, short drw_y, short src_w, short src_h, short drw_w, short drw_h, @@ -809,7 +809,7 @@ static int i915_xvmc_put_image(ScrnInfoPtr pScrn, if ((xvmc_cmd->srfNo >= I915_XVMC_MAX_SURFACES) || !pXvMC->surfaces[xvmc_cmd->srfNo] || !pXvMC->sfprivs[xvmc_cmd->srfNo]) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + xf86DrvMsg(scrn->scrnIndex, X_ERROR, "[XvMC] i915 put image: Invalid parameters!\n"); return 1; } @@ -825,25 +825,25 @@ static int i915_xvmc_put_image(ScrnInfoPtr pScrn, } ret = - pXvMC->savePutImage(pScrn, src_x, src_y, drw_x, drw_y, src_w, src_h, + pXvMC->savePutImage(scrn, src_x, src_y, drw_x, drw_y, src_w, src_h, drw_w, drw_h, id, buf, width, height, sync, clipBoxes, data, pDraw); return ret; } -static Bool i915_xvmc_init(ScrnInfoPtr pScrn, XF86VideoAdaptorPtr XvAdapt) +static Bool i915_xvmc_init(ScrnInfoPtr scrn, XF86VideoAdaptorPtr XvAdapt) { I915XvMCPtr pXvMC; pXvMC = (I915XvMCPtr) xcalloc(1, sizeof(I915XvMC)); if (!pXvMC) { - xf86DrvMsg(pScrn->scrnIndex, X_WARNING, + xf86DrvMsg(scrn->scrnIndex, X_WARNING, "[XvMC] alloc driver private failed!\n"); return FALSE; } xvmc_driver->devPrivate = (void *)pXvMC; - if (!intel_xvmc_init_batch(pScrn)) { - xf86DrvMsg(pScrn->scrnIndex, X_WARNING, + if (!intel_xvmc_init_batch(scrn)) { + xf86DrvMsg(scrn->scrnIndex, X_WARNING, "[XvMC] fail to init batch buffer\n"); xfree(pXvMC); return FALSE; @@ -856,12 +856,12 @@ static Bool i915_xvmc_init(ScrnInfoPtr pScrn, XF86VideoAdaptorPtr XvAdapt) return TRUE; } -static void i915_xvmc_fini(ScrnInfoPtr pScrn) +static void i915_xvmc_fini(ScrnInfoPtr scrn) { I915XvMCPtr pXvMC = (I915XvMCPtr) xvmc_driver->devPrivate; cleanupI915XvMC(pXvMC); - intel_xvmc_fini_batch(pScrn); + intel_xvmc_fini_batch(scrn); xfree(xvmc_driver->devPrivate); } diff --git a/src/i915_render.c b/src/i915_render.c index 389fa9d0..2616481a 100644 --- a/src/i915_render.c +++ b/src/i915_render.c @@ -158,9 +158,9 @@ static Bool i915_get_dest_format(PicturePtr pDstPicture, uint32_t * dst_format) break; default: { - ScrnInfoPtr pScrn; + ScrnInfoPtr scrn; - pScrn = + scrn = xf86Screens[pDstPicture->pDrawable->pScreen->myNum]; I830FALLBACK("Unsupported dest format 0x%x\n", (int)pDstPicture->format); @@ -169,7 +169,7 @@ static Bool i915_get_dest_format(PicturePtr pDstPicture, uint32_t * dst_format) return TRUE; } -static Bool i915_check_composite_texture(ScrnInfoPtr pScrn, PicturePtr pPict, +static Bool i915_check_composite_texture(ScrnInfoPtr scrn, PicturePtr pPict, int unit) { if (pPict->repeatType > RepeatReflect) @@ -206,7 +206,7 @@ Bool i915_check_composite(int op, PicturePtr pSrcPicture, PicturePtr pMaskPicture, PicturePtr pDstPicture) { - ScrnInfoPtr pScrn = xf86Screens[pDstPicture->pDrawable->pScreen->myNum]; + ScrnInfoPtr scrn = xf86Screens[pDstPicture->pDrawable->pScreen->myNum]; uint32_t tmp1; /* Check for unsupported compositing operations. */ @@ -225,10 +225,10 @@ i915_check_composite(int op, PicturePtr pSrcPicture, PicturePtr pMaskPicture, "blending.\n"); } - if (!i915_check_composite_texture(pScrn, pSrcPicture, 0)) + if (!i915_check_composite_texture(scrn, pSrcPicture, 0)) I830FALLBACK("Check Src picture texture\n"); if (pMaskPicture != NULL - && !i915_check_composite_texture(pScrn, pMaskPicture, 1)) + && !i915_check_composite_texture(scrn, pMaskPicture, 1)) I830FALLBACK("Check Mask picture texture\n"); if (!i915_get_dest_format(pDstPicture, &tmp1)) @@ -239,8 +239,8 @@ i915_check_composite(int op, PicturePtr pSrcPicture, PicturePtr pMaskPicture, static Bool i915_texture_setup(PicturePtr pPict, PixmapPtr pPix, int unit) { - ScrnInfoPtr pScrn = xf86Screens[pPict->pDrawable->pScreen->myNum]; - intel_screen_private *intel = intel_get_screen_private(pScrn); + ScrnInfoPtr scrn = xf86Screens[pPict->pDrawable->pScreen->myNum]; + intel_screen_private *intel = intel_get_screen_private(scrn); uint32_t format, pitch, filter; int w, h, i; uint32_t wrap_mode; @@ -320,8 +320,8 @@ i915_prepare_composite(int op, PicturePtr pSrcPicture, PicturePtr pMaskPicture, PicturePtr pDstPicture, PixmapPtr pSrc, PixmapPtr pMask, PixmapPtr pDst) { - ScrnInfoPtr pScrn = xf86Screens[pSrcPicture->pDrawable->pScreen->myNum]; - intel_screen_private *intel = intel_get_screen_private(pScrn); + ScrnInfoPtr scrn = xf86Screens[pSrcPicture->pDrawable->pScreen->myNum]; + intel_screen_private *intel = intel_get_screen_private(scrn); drm_intel_bo *bo_table[] = { NULL, /* batch_bo */ i830_get_pixmap_bo(pSrc), @@ -345,7 +345,7 @@ i915_prepare_composite(int op, PicturePtr pSrcPicture, &intel->i915_render_state.dst_format)) return FALSE; - if (!i830_get_aperture_space(pScrn, bo_table, ARRAY_SIZE(bo_table))) + if (!i830_get_aperture_space(scrn, bo_table, ARRAY_SIZE(bo_table))) return FALSE; if (!i915_texture_setup(pSrcPicture, pSrc, 0)) @@ -374,9 +374,9 @@ i915_prepare_composite(int op, PicturePtr pSrcPicture, return TRUE; } -static void i915_emit_composite_setup(ScrnInfoPtr pScrn) +static void i915_emit_composite_setup(ScrnInfoPtr scrn) { - intel_screen_private *intel = intel_get_screen_private(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); int op = intel->i915_render_state.op; PicturePtr pSrcPicture = intel->render_src_picture; PicturePtr pMaskPicture = intel->render_mask_picture; @@ -392,7 +392,7 @@ static void i915_emit_composite_setup(ScrnInfoPtr pScrn) intel->i915_render_state.needs_emit = FALSE; - IntelEmitInvarientState(pScrn); + IntelEmitInvarientState(scrn); intel->last_3d = LAST_3D_RENDER; dst_pitch = intel_get_pixmap_pitch(pDst); @@ -570,8 +570,8 @@ i915_emit_composite_primitive(PixmapPtr pDst, int maskX, int maskY, int dstX, int dstY, int w, int h) { - ScrnInfoPtr pScrn = xf86Screens[pDst->drawable.pScreen->myNum]; - intel_screen_private *intel = intel_get_screen_private(pScrn); + ScrnInfoPtr scrn = xf86Screens[pDst->drawable.pScreen->myNum]; + intel_screen_private *intel = intel_get_screen_private(scrn); Bool is_affine_src, is_affine_mask = TRUE; int per_vertex, num_floats; float src_x[3], src_y[3], src_w[3], mask_x[3], mask_y[3], mask_w[3]; @@ -755,23 +755,23 @@ void i915_composite(PixmapPtr pDst, int srcX, int srcY, int maskX, int maskY, int dstX, int dstY, int w, int h) { - ScrnInfoPtr pScrn = xf86Screens[pDst->drawable.pScreen->myNum]; - intel_screen_private *intel = intel_get_screen_private(pScrn); + ScrnInfoPtr scrn = xf86Screens[pDst->drawable.pScreen->myNum]; + intel_screen_private *intel = intel_get_screen_private(scrn); - intel_batch_start_atomic(pScrn, 150); + intel_batch_start_atomic(scrn, 150); if (intel->i915_render_state.needs_emit) - i915_emit_composite_setup(pScrn); + i915_emit_composite_setup(scrn); i915_emit_composite_primitive(pDst, srcX, srcY, maskX, maskY, dstX, dstY, w, h); - intel_batch_end_atomic(pScrn); + intel_batch_end_atomic(scrn); } -void i915_batch_flush_notify(ScrnInfoPtr pScrn) +void i915_batch_flush_notify(ScrnInfoPtr scrn) { - intel_screen_private *intel = intel_get_screen_private(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); intel->i915_render_state.needs_emit = TRUE; } diff --git a/src/i915_video.c b/src/i915_video.c index e2080e77..2b805e49 100644 --- a/src/i915_video.c +++ b/src/i915_video.c @@ -40,14 +40,14 @@ #include "i915_3d.h" void -I915DisplayVideoTextured(ScrnInfoPtr pScrn, I830PortPrivPtr pPriv, int id, +I915DisplayVideoTextured(ScrnInfoPtr scrn, I830PortPrivPtr pPriv, int id, RegionPtr dstRegion, short width, short height, int video_pitch, int video_pitch2, int x1, int y1, int x2, int y2, short src_w, short src_h, short drw_w, short drw_h, PixmapPtr pPixmap) { - intel_screen_private *intel = intel_get_screen_private(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); uint32_t format, ms3, s5; BoxPtr pbox = REGION_RECTS(dstRegion); int nbox_total = REGION_NUM_RECTS(dstRegion); @@ -69,9 +69,9 @@ I915DisplayVideoTextured(ScrnInfoPtr pScrn, I830PortPrivPtr pPriv, int id, nbox_this_time = BOXES_IN_BYTES(BATCH_BYTES(intel)); nbox_total -= nbox_this_time; - intel_batch_start_atomic(pScrn, 200 + 20 * nbox_this_time); + intel_batch_start_atomic(scrn, 200 + 20 * nbox_this_time); - IntelEmitInvarientState(pScrn); + IntelEmitInvarientState(scrn); intel->last_3d = LAST_3D_VIDEO; BEGIN_BATCH(20); @@ -453,6 +453,6 @@ I915DisplayVideoTextured(ScrnInfoPtr pScrn, I830PortPrivPtr pPriv, int id, ADVANCE_BATCH(); } - intel_batch_end_atomic(pScrn); + intel_batch_end_atomic(scrn); } } diff --git a/src/i965_hwmc.c b/src/i965_hwmc.c index 261a2700..76acb86a 100644 --- a/src/i965_hwmc.c +++ b/src/i965_hwmc.c @@ -50,12 +50,12 @@ static PutImageFuncPtr XvPutImage; -static int create_context(ScrnInfoPtr pScrn, +static int create_context(ScrnInfoPtr scrn, XvMCContextPtr context, int *num_privates, CARD32 ** private) { struct i965_xvmc_context *private_context, *context_dup; - intel_screen_private *intel = intel_get_screen_private(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); unsigned int blocknum = (((context->width + 15) / 16) * ((context->height + 15) / 16)); @@ -85,14 +85,14 @@ static int create_context(ScrnInfoPtr pScrn, return Success; } -static void destroy_context(ScrnInfoPtr pScrn, XvMCContextPtr context) +static void destroy_context(ScrnInfoPtr scrn, XvMCContextPtr context) { struct i965_xvmc_context *private_context; private_context = context->driver_priv; Xfree(private_context); } -static int create_surface(ScrnInfoPtr pScrn, XvMCSurfacePtr surface, +static int create_surface(ScrnInfoPtr scrn, XvMCSurfacePtr surface, int *num_priv, CARD32 ** priv) { XvMCContextPtr ctx = surface->context; @@ -131,7 +131,7 @@ static int create_surface(ScrnInfoPtr pScrn, XvMCSurfacePtr surface, return Success; } -static void destory_surface(ScrnInfoPtr pScrn, XvMCSurfacePtr surface) +static void destory_surface(ScrnInfoPtr scrn, XvMCSurfacePtr surface) { XvMCContextPtr ctx = surface->context; struct i965_xvmc_surface *priv_surface = surface->driver_priv; @@ -140,17 +140,17 @@ static void destory_surface(ScrnInfoPtr pScrn, XvMCSurfacePtr surface) Xfree(priv_surface); } -static int create_subpicture(ScrnInfoPtr pScrn, XvMCSubpicturePtr subpicture, +static int create_subpicture(ScrnInfoPtr scrn, XvMCSubpicturePtr subpicture, int *num_priv, CARD32 ** priv) { return Success; } -static void destroy_subpicture(ScrnInfoPtr pScrn, XvMCSubpicturePtr subpicture) +static void destroy_subpicture(ScrnInfoPtr scrn, XvMCSubpicturePtr subpicture) { } -static int put_image(ScrnInfoPtr pScrn, +static int put_image(ScrnInfoPtr scrn, short src_x, short src_y, short drw_x, short drw_y, short src_w, short src_h, short drw_w, short drw_h, @@ -158,7 +158,7 @@ static int put_image(ScrnInfoPtr pScrn, short height, Bool sync, RegionPtr clipBoxes, pointer data, DrawablePtr pDraw) { - intel_screen_private *intel = intel_get_screen_private(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); struct intel_xvmc_command *cmd = (struct intel_xvmc_command *)buf; dri_bo *bo; @@ -171,7 +171,7 @@ static int put_image(ScrnInfoPtr pScrn, buf = intel->FbBase + bo->offset; #endif } - XvPutImage(pScrn, src_x, src_y, drw_x, drw_y, src_w, src_h, + XvPutImage(scrn, src_x, src_y, drw_x, drw_y, src_w, src_h, drw_w, drw_h, id, buf, width, height, sync, clipBoxes, data, pDraw); diff --git a/src/i965_render.c b/src/i965_render.c index 9f4b1c0b..17ae558f 100644 --- a/src/i965_render.c +++ b/src/i965_render.c @@ -151,7 +151,7 @@ static void i965_get_blend_cntl(int op, PicturePtr pMask, uint32_t dst_format, static Bool i965_get_dest_format(PicturePtr pDstPicture, uint32_t * dst_format) { - ScrnInfoPtr pScrn = xf86Screens[pDstPicture->pDrawable->pScreen->myNum]; + ScrnInfoPtr scrn = xf86Screens[pDstPicture->pDrawable->pScreen->myNum]; switch (pDstPicture->format) { case PICT_a8r8g8b8: @@ -182,7 +182,7 @@ static Bool i965_get_dest_format(PicturePtr pDstPicture, uint32_t * dst_format) return TRUE; } -static Bool i965_check_composite_texture(ScrnInfoPtr pScrn, PicturePtr pPict, +static Bool i965_check_composite_texture(ScrnInfoPtr scrn, PicturePtr pPict, int unit) { if (pPict->repeatType > RepeatReflect) @@ -220,7 +220,7 @@ Bool i965_check_composite(int op, PicturePtr pSrcPicture, PicturePtr pMaskPicture, PicturePtr pDstPicture) { - ScrnInfoPtr pScrn = xf86Screens[pDstPicture->pDrawable->pScreen->myNum]; + ScrnInfoPtr scrn = xf86Screens[pDstPicture->pDrawable->pScreen->myNum]; uint32_t tmp1; /* Check for unsupported compositing operations. */ @@ -241,10 +241,10 @@ i965_check_composite(int op, PicturePtr pSrcPicture, PicturePtr pMaskPicture, } } - if (!i965_check_composite_texture(pScrn, pSrcPicture, 0)) + if (!i965_check_composite_texture(scrn, pSrcPicture, 0)) I830FALLBACK("Check Src picture texture\n"); if (pMaskPicture != NULL - && !i965_check_composite_texture(pScrn, pMaskPicture, 1)) + && !i965_check_composite_texture(scrn, pMaskPicture, 1)) I830FALLBACK("Check Mask picture texture\n"); if (!i965_get_dest_format(pDstPicture, &tmp1)) @@ -1094,9 +1094,9 @@ i965_set_picture_surface_state(dri_bo * ss_bo, int ss_index, } } -static void i965_emit_composite_state(ScrnInfoPtr pScrn) +static void i965_emit_composite_state(ScrnInfoPtr scrn) { - intel_screen_private *intel = intel_get_screen_private(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); struct gen4_render_state *render_state = intel->gen4_render_state; gen4_composite_op *composite_op = &render_state->composite_op; int op = composite_op->op; @@ -1119,7 +1119,7 @@ static void i965_emit_composite_state(ScrnInfoPtr pScrn) render_state->needs_state_emit = FALSE; - IntelEmitInvarientState(pScrn); + IntelEmitInvarientState(scrn); intel->last_3d = LAST_3D_RENDER; urb_vs_start = 0; @@ -1411,9 +1411,9 @@ static void i965_emit_composite_state(ScrnInfoPtr pScrn) * Returns whether the current set of composite state plus vertex buffer is * expected to fit in the aperture. */ -static Bool i965_composite_check_aperture(ScrnInfoPtr pScrn) +static Bool i965_composite_check_aperture(ScrnInfoPtr scrn) { - intel_screen_private *intel = intel_get_screen_private(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); struct gen4_render_state *render_state = intel->gen4_render_state; gen4_composite_op *composite_op = &render_state->composite_op; drm_intel_bo *bo_table[] = { @@ -1441,8 +1441,8 @@ i965_prepare_composite(int op, PicturePtr pSrcPicture, PicturePtr pMaskPicture, PicturePtr pDstPicture, PixmapPtr pSrc, PixmapPtr pMask, PixmapPtr pDst) { - ScrnInfoPtr pScrn = xf86Screens[pDstPicture->pDrawable->pScreen->myNum]; - intel_screen_private *intel = intel_get_screen_private(pScrn); + ScrnInfoPtr scrn = xf86Screens[pDstPicture->pDrawable->pScreen->myNum]; + intel_screen_private *intel = intel_get_screen_private(scrn); struct gen4_render_state *render_state = intel->gen4_render_state; gen4_composite_op *composite_op = &render_state->composite_op; uint32_t *binding_table; @@ -1595,9 +1595,9 @@ i965_prepare_composite(int op, PicturePtr pSrcPicture, composite_op->wm_kernel = WM_KERNEL_NOMASK_PROJECTIVE; } - if (!i965_composite_check_aperture(pScrn)) { - intel_batch_flush(pScrn, FALSE); - if (!i965_composite_check_aperture(pScrn)) + if (!i965_composite_check_aperture(scrn)) { + intel_batch_flush(scrn, FALSE); + if (!i965_composite_check_aperture(scrn)) I830FALLBACK ("Couldn't fit render operation in aperture\n"); } @@ -1607,9 +1607,9 @@ i965_prepare_composite(int op, PicturePtr pSrcPicture, return TRUE; } -static drm_intel_bo *i965_get_vb_space(ScrnInfoPtr pScrn) +static drm_intel_bo *i965_get_vb_space(ScrnInfoPtr scrn) { - intel_screen_private *intel = intel_get_screen_private(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); struct gen4_render_state *render_state = intel->gen4_render_state; /* If the vertex buffer is too full, then we free the old and a new one @@ -1637,8 +1637,8 @@ void i965_composite(PixmapPtr pDst, int srcX, int srcY, int maskX, int maskY, int dstX, int dstY, int w, int h) { - ScrnInfoPtr pScrn = xf86Screens[pDst->drawable.pScreen->myNum]; - intel_screen_private *intel = intel_get_screen_private(pScrn); + ScrnInfoPtr scrn = xf86Screens[pDst->drawable.pScreen->myNum]; + intel_screen_private *intel = intel_get_screen_private(scrn); struct gen4_render_state *render_state = intel->gen4_render_state; Bool has_mask; float src_x[3], src_y[3], src_w[3], mask_x[3], mask_y[3], mask_w[3]; @@ -1718,7 +1718,7 @@ i965_composite(PixmapPtr pDst, int srcX, int srcY, int maskX, int maskY, } } - vb_bo = i965_get_vb_space(pScrn); + vb_bo = i965_get_vb_space(scrn); if (vb_bo == NULL) return; i = 0; @@ -1766,12 +1766,12 @@ i965_composite(PixmapPtr pDst, int srcX, int srcY, int maskX, int maskY, assert(i <= VERTEX_BUFFER_SIZE); drm_intel_bo_subdata(vb_bo, render_state->vb_offset * 4, i * 4, vb); - if (!i965_composite_check_aperture(pScrn)) - intel_batch_flush(pScrn, FALSE); + if (!i965_composite_check_aperture(scrn)) + intel_batch_flush(scrn, FALSE); - intel_batch_start_atomic(pScrn, 200); + intel_batch_start_atomic(scrn, 200); if (render_state->needs_state_emit) - i965_emit_composite_state(pScrn); + i965_emit_composite_state(scrn); BEGIN_BATCH(12); OUT_BATCH(MI_FLUSH); @@ -1803,14 +1803,14 @@ i965_composite(PixmapPtr pDst, int srcX, int srcY, int maskX, int maskY, render_state->vb_offset += i; drm_intel_bo_unreference(vb_bo); - intel_batch_end_atomic(pScrn); + intel_batch_end_atomic(scrn); - i830_debug_sync(pScrn); + i830_debug_sync(scrn); } -void i965_batch_flush_notify(ScrnInfoPtr pScrn) +void i965_batch_flush_notify(ScrnInfoPtr scrn) { - intel_screen_private *intel = intel_get_screen_private(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); struct gen4_render_state *render_state = intel->gen4_render_state; /* Once a batch is emitted, we never want to map again any buffer @@ -1827,9 +1827,9 @@ void i965_batch_flush_notify(ScrnInfoPtr pScrn) /** * Called at EnterVT so we can set up our offsets into the state buffer. */ -void gen4_render_state_init(ScrnInfoPtr pScrn) +void gen4_render_state_init(ScrnInfoPtr scrn) { - intel_screen_private *intel = intel_get_screen_private(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); struct gen4_render_state *render_state; int i, j, k, l, m; drm_intel_bo *sf_kernel_bo, *sf_kernel_mask_bo; @@ -1841,32 +1841,32 @@ void gen4_render_state_init(ScrnInfoPtr pScrn) render_state = intel->gen4_render_state; render_state->vb_offset = 0; - render_state->vs_state_bo = gen4_create_vs_unit_state(pScrn); + render_state->vs_state_bo = gen4_create_vs_unit_state(scrn); /* Set up the two SF states (one for blending with a mask, one without) */ if (IS_IGDNG(intel)) { - sf_kernel_bo = intel_bo_alloc_for_data(pScrn, + sf_kernel_bo = intel_bo_alloc_for_data(scrn, sf_kernel_static_gen5, sizeof (sf_kernel_static_gen5), "sf kernel gen5"); sf_kernel_mask_bo = - intel_bo_alloc_for_data(pScrn, sf_kernel_mask_static_gen5, + intel_bo_alloc_for_data(scrn, sf_kernel_mask_static_gen5, sizeof(sf_kernel_mask_static_gen5), "sf mask kernel"); } else { - sf_kernel_bo = intel_bo_alloc_for_data(pScrn, + sf_kernel_bo = intel_bo_alloc_for_data(scrn, sf_kernel_static, sizeof(sf_kernel_static), "sf kernel"); - sf_kernel_mask_bo = intel_bo_alloc_for_data(pScrn, + sf_kernel_mask_bo = intel_bo_alloc_for_data(scrn, sf_kernel_mask_static, sizeof (sf_kernel_mask_static), "sf mask kernel"); } - render_state->sf_state_bo = gen4_create_sf_state(pScrn, sf_kernel_bo); - render_state->sf_mask_state_bo = gen4_create_sf_state(pScrn, + render_state->sf_state_bo = gen4_create_sf_state(scrn, sf_kernel_bo); + render_state->sf_mask_state_bo = gen4_create_sf_state(scrn, sf_kernel_mask_bo); drm_intel_bo_unreference(sf_kernel_bo); drm_intel_bo_unreference(sf_kernel_mask_bo); @@ -1874,13 +1874,13 @@ void gen4_render_state_init(ScrnInfoPtr pScrn) for (m = 0; m < WM_KERNEL_COUNT; m++) { if (IS_IGDNG(intel)) render_state->wm_kernel_bo[m] = - intel_bo_alloc_for_data(pScrn, + intel_bo_alloc_for_data(scrn, wm_kernels_gen5[m].data, wm_kernels_gen5[m].size, "WM kernel gen5"); else render_state->wm_kernel_bo[m] = - intel_bo_alloc_for_data(pScrn, + intel_bo_alloc_for_data(scrn, wm_kernels[m].data, wm_kernels[m].size, "WM kernel"); @@ -1889,7 +1889,7 @@ void gen4_render_state_init(ScrnInfoPtr pScrn) /* Set up the WM states: each filter/extend type for source and mask, per * kernel. */ - border_color_bo = sampler_border_color_create(pScrn); + border_color_bo = sampler_border_color_create(scrn); for (i = 0; i < SAMPLER_STATE_FILTER_COUNT; i++) { for (j = 0; j < SAMPLER_STATE_EXTEND_COUNT; j++) { for (k = 0; k < SAMPLER_STATE_FILTER_COUNT; k++) { @@ -1897,7 +1897,7 @@ void gen4_render_state_init(ScrnInfoPtr pScrn) drm_intel_bo *sampler_state_bo; sampler_state_bo = - gen4_create_sampler_state(pScrn, + gen4_create_sampler_state(scrn, i, j, k, l, border_color_bo); @@ -1908,7 +1908,7 @@ void gen4_render_state_init(ScrnInfoPtr pScrn) wm_state_bo[m][i][j] [k][l] = gen4_create_wm_state - (pScrn, + (scrn, wm_kernels_gen5[m]. has_mask, render_state-> @@ -1919,7 +1919,7 @@ void gen4_render_state_init(ScrnInfoPtr pScrn) wm_state_bo[m][i][j] [k][l] = gen4_create_wm_state - (pScrn, + (scrn, wm_kernels[m]. has_mask, render_state-> @@ -1934,8 +1934,8 @@ void gen4_render_state_init(ScrnInfoPtr pScrn) } drm_intel_bo_unreference(border_color_bo); - render_state->cc_state_bo = gen4_create_cc_unit_state(pScrn); - render_state->sip_kernel_bo = intel_bo_alloc_for_data(pScrn, + render_state->cc_state_bo = gen4_create_cc_unit_state(scrn); + render_state->sip_kernel_bo = intel_bo_alloc_for_data(scrn, sip_kernel_static, sizeof (sip_kernel_static), @@ -1945,9 +1945,9 @@ void gen4_render_state_init(ScrnInfoPtr pScrn) /** * Called at LeaveVT. */ -void gen4_render_state_cleanup(ScrnInfoPtr pScrn) +void gen4_render_state_cleanup(ScrnInfoPtr scrn) { - intel_screen_private *intel = intel_get_screen_private(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); struct gen4_render_state *render_state = intel->gen4_render_state; int i, j, k, l, m; gen4_composite_op *composite_op = &render_state->composite_op; diff --git a/src/i965_video.c b/src/i965_video.c index b35979bb..d313e6cf 100644 --- a/src/i965_video.c +++ b/src/i965_video.c @@ -155,13 +155,13 @@ static struct { BRW_SVG_CTL_SIP, "System Instruction Pointer"}, { 0, 0},}; -static void brw_debug(ScrnInfoPtr pScrn, char *when) +static void brw_debug(ScrnInfoPtr scrn, char *when) { - intel_screen_private *intel = intel_get_screen_private(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); int i; uint32_t v; - I830Sync(pScrn); + I830Sync(scrn); ErrorF("brw_debug: %s\n", when); for (i = 0; svg_ctl_bits[i].name; i++) { OUTREG(BRW_SVG_CTL, svg_ctl_bits[i].svg_ctl); @@ -755,9 +755,9 @@ static drm_intel_bo *i965_create_cc_state(ScrnInfoPtr scrn) } static void -i965_emit_video_setup(ScrnInfoPtr pScrn, drm_intel_bo * bind_bo, int n_src_surf) +i965_emit_video_setup(ScrnInfoPtr scrn, drm_intel_bo * bind_bo, int n_src_surf) { - intel_screen_private *intel = intel_get_screen_private(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); int urb_vs_start, urb_vs_size; int urb_gs_start, urb_gs_size; int urb_clip_start, urb_clip_size; @@ -765,7 +765,7 @@ i965_emit_video_setup(ScrnInfoPtr pScrn, drm_intel_bo * bind_bo, int n_src_surf) int urb_cs_start, urb_cs_size; int pipe_ctl; - IntelEmitInvarientState(pScrn); + IntelEmitInvarientState(scrn); intel->last_3d = LAST_3D_VIDEO; urb_vs_start = 0; @@ -786,7 +786,7 @@ i965_emit_video_setup(ScrnInfoPtr pScrn, drm_intel_bo * bind_bo, int n_src_surf) OUT_BATCH(MI_NOOP); ADVANCE_BATCH(); - /* brw_debug (pScrn, "before base address modify"); */ + /* brw_debug (scrn, "before base address modify"); */ if (IS_IGDNG(intel)) BEGIN_BATCH(14); else @@ -837,7 +837,7 @@ i965_emit_video_setup(ScrnInfoPtr pScrn, drm_intel_bo * bind_bo, int n_src_surf) OUT_BATCH(MI_NOOP); ADVANCE_BATCH(); - /* brw_debug (pScrn, "after base address modify"); */ + /* brw_debug (scrn, "after base address modify"); */ if (IS_IGDNG(intel)) pipe_ctl = BRW_PIPE_CONTROL_NOWRITE; @@ -875,7 +875,7 @@ i965_emit_video_setup(ScrnInfoPtr pScrn, drm_intel_bo * bind_bo, int n_src_surf) */ OUT_BATCH(BRW_3DSTATE_DRAWING_RECTANGLE | 2); /* XXX 3 for BLC or CTG */ OUT_BATCH(0x00000000); /* ymin, xmin */ - OUT_BATCH((pScrn->virtualX - 1) | (pScrn->virtualY - 1) << 16); /* ymax, xmax */ + OUT_BATCH((scrn->virtualX - 1) | (scrn->virtualY - 1) << 16); /* ymax, xmax */ OUT_BATCH(0x00000000); /* yorigin, xorigin */ /* skip the depth buffer */ @@ -977,14 +977,14 @@ i965_emit_video_setup(ScrnInfoPtr pScrn, drm_intel_bo * bind_bo, int n_src_surf) } void -I965DisplayVideoTextured(ScrnInfoPtr pScrn, I830PortPrivPtr pPriv, int id, +I965DisplayVideoTextured(ScrnInfoPtr scrn, I830PortPrivPtr pPriv, int id, RegionPtr dstRegion, short width, short height, int video_pitch, int x1, int y1, int x2, int y2, short src_w, short src_h, short drw_w, short drw_h, PixmapPtr pPixmap) { - intel_screen_private *intel = intel_get_screen_private(pScrn); + intel_screen_private *intel = intel_get_screen_private(scrn); BoxPtr pbox; int nbox, dxo, dyo, pix_xoff, pix_yoff; float src_scale_x, src_scale_y; @@ -1054,12 +1054,12 @@ I965DisplayVideoTextured(ScrnInfoPtr pScrn, I830PortPrivPtr pPriv, int id, */ /* Upload kernels */ - surf_bos[0] = i965_create_dst_surface_state(pScrn, pPixmap); + surf_bos[0] = i965_create_dst_surface_state(scrn, pPixmap); if (!surf_bos[0]) return; for (src_surf = 0; src_surf < n_src_surf; src_surf++) { - drm_intel_bo *surf_bo = i965_create_src_surface_state(pScrn, + drm_intel_bo *surf_bo = i965_create_src_surface_state(scrn, pPriv-> buf, src_surf_base @@ -1079,7 +1079,7 @@ I965DisplayVideoTextured(ScrnInfoPtr pScrn, I830PortPrivPtr pPriv, int id, } surf_bos[src_surf + 1] = surf_bo; } - bind_bo = i965_create_binding_table(pScrn, surf_bos, n_src_surf + 1); + bind_bo = i965_create_binding_table(scrn, surf_bos, n_src_surf + 1); for (i = 0; i < n_src_surf + 1; i++) { drm_intel_bo_unreference(surf_bos[i]); surf_bos[i] = NULL; @@ -1088,10 +1088,10 @@ I965DisplayVideoTextured(ScrnInfoPtr pScrn, I830PortPrivPtr pPriv, int id, return; if (intel->video.gen4_sampler_bo == NULL) - intel->video.gen4_sampler_bo = i965_create_sampler_state(pScrn); + intel->video.gen4_sampler_bo = i965_create_sampler_state(scrn); if (intel->video.gen4_sip_kernel_bo == NULL) { intel->video.gen4_sip_kernel_bo = - i965_create_program(pScrn, &sip_kernel_static[0][0], + i965_create_program(scrn, &sip_kernel_static[0][0], sizeof(sip_kernel_static)); if (!intel->video.gen4_sip_kernel_bo) { drm_intel_bo_unreference(bind_bo); @@ -1100,14 +1100,14 @@ I965DisplayVideoTextured(ScrnInfoPtr pScrn, I830PortPrivPtr pPriv, int id, } if (intel->video.gen4_vs_bo == NULL) { - intel->video.gen4_vs_bo = i965_create_vs_state(pScrn); + intel->video.gen4_vs_bo = i965_create_vs_state(scrn); if (!intel->video.gen4_vs_bo) { drm_intel_bo_unreference(bind_bo); return; } } if (intel->video.gen4_sf_bo == NULL) { - intel->video.gen4_sf_bo = i965_create_sf_state(pScrn); + intel->video.gen4_sf_bo = i965_create_sf_state(scrn); if (!intel->video.gen4_sf_bo) { drm_intel_bo_unreference(bind_bo); return; @@ -1115,7 +1115,7 @@ I965DisplayVideoTextured(ScrnInfoPtr pScrn, I830PortPrivPtr pPriv, int id, } if (intel->video.gen4_wm_packed_bo == NULL) { intel->video.gen4_wm_packed_bo = - i965_create_wm_state(pScrn, intel->video.gen4_sampler_bo, + i965_create_wm_state(scrn, intel->video.gen4_sampler_bo, TRUE); if (!intel->video.gen4_wm_packed_bo) { drm_intel_bo_unreference(bind_bo); @@ -1125,7 +1125,7 @@ I965DisplayVideoTextured(ScrnInfoPtr pScrn, I830PortPrivPtr pPriv, int id, if (intel->video.gen4_wm_planar_bo == NULL) { intel->video.gen4_wm_planar_bo = - i965_create_wm_state(pScrn, intel->video.gen4_sampler_bo, + i965_create_wm_state(scrn, intel->video.gen4_sampler_bo, FALSE); if (!intel->video.gen4_wm_planar_bo) { drm_intel_bo_unreference(bind_bo); @@ -1134,7 +1134,7 @@ I965DisplayVideoTextured(ScrnInfoPtr pScrn, I830PortPrivPtr pPriv, int id, } if (intel->video.gen4_cc_bo == NULL) { - intel->video.gen4_cc_bo = i965_create_cc_state(pScrn); + intel->video.gen4_cc_bo = i965_create_cc_state(scrn); if (!intel->video.gen4_cc_bo) { drm_intel_bo_unreference(bind_bo); return; @@ -1208,7 +1208,7 @@ I965DisplayVideoTextured(ScrnInfoPtr pScrn, I830PortPrivPtr pPriv, int id, drm_intel_bo_unmap(vb_bo); if (!IS_IGDNG(intel)) - i965_pre_draw_debug(pScrn); + i965_pre_draw_debug(scrn); /* If this command won't fit in the current batch, flush. * Assume that it does after being flushed. @@ -1216,12 +1216,12 @@ I965DisplayVideoTextured(ScrnInfoPtr pScrn, I830PortPrivPtr pPriv, int id, if (drm_intel_bufmgr_check_aperture_space(bo_table, ARRAY_SIZE(bo_table)) < 0) { - intel_batch_flush(pScrn, FALSE); + intel_batch_flush(scrn, FALSE); } - intel_batch_start_atomic(pScrn, 100); + intel_batch_start_atomic(scrn, 100); - i965_emit_video_setup(pScrn, bind_bo, n_src_surf); + i965_emit_video_setup(scrn, bind_bo, n_src_surf); BEGIN_BATCH(12); /* Set up the pointer to our vertex buffer */ @@ -1247,12 +1247,12 @@ I965DisplayVideoTextured(ScrnInfoPtr pScrn, I830PortPrivPtr pPriv, int id, OUT_BATCH(MI_NOOP); ADVANCE_BATCH(); - intel_batch_end_atomic(pScrn); + intel_batch_end_atomic(scrn); drm_intel_bo_unreference(vb_bo); if (!IS_IGDNG(intel)) - i965_post_draw_debug(pScrn); + i965_post_draw_debug(scrn); } @@ -1260,7 +1260,7 @@ I965DisplayVideoTextured(ScrnInfoPtr pScrn, I830PortPrivPtr pPriv, int id, drm_intel_bo_unreference(bind_bo); #if WATCH_STATS - /* i830_dump_error_state(pScrn); */ + /* i830_dump_error_state(scrn); */ #endif } |