Lines Matching defs:ctxpriv
218 static Bool i915_map_xvmc_buffers(ScrnInfoPtr pScrn, I915XvMCContextPriv *ctxpriv)
223 (drm_handle_t)(ctxpriv->mcStaticIndirectState->offset + pI830->LinearAddr),
224 ctxpriv->mcStaticIndirectState->size, DRM_AGP, 0,
225 (drmAddress)&ctxpriv->sis_handle) < 0) {
232 (drm_handle_t)(ctxpriv->mcSamplerState->offset + pI830->LinearAddr),
233 ctxpriv->mcSamplerState->size, DRM_AGP, 0,
234 (drmAddress)&ctxpriv->ssb_handle) < 0) {
241 (drm_handle_t)(ctxpriv->mcMapState->offset + pI830->LinearAddr),
242 ctxpriv->mcMapState->size, DRM_AGP, 0,
243 (drmAddress)&ctxpriv->msb_handle) < 0) {
250 (drm_handle_t)(ctxpriv->mcPixelShaderProgram->offset + pI830->LinearAddr),
251 ctxpriv->mcPixelShaderProgram->size, DRM_AGP, 0,
252 (drmAddress)&ctxpriv->psp_handle) < 0) {
259 (drm_handle_t)(ctxpriv->mcPixelShaderConstants->offset + pI830->LinearAddr),
260 ctxpriv->mcPixelShaderConstants->size, DRM_AGP, 0,
261 (drmAddress)&ctxpriv->psc_handle) < 0) {
268 (drm_handle_t)(ctxpriv->mcCorrdata->offset + pI830->LinearAddr),
269 ctxpriv->mcCorrdata->size, DRM_AGP, 0,
270 (drmAddress)&ctxpriv->corrdata_handle) < 0) {
280 static void i915_unmap_xvmc_buffers(ScrnInfoPtr pScrn, I915XvMCContextPriv *ctxpriv)
284 if (ctxpriv->sis_handle) {
285 drmRmMap(pI830->drmSubFD, ctxpriv->sis_handle);
286 ctxpriv->sis_handle = 0;
289 if (ctxpriv->ssb_handle) {
290 drmRmMap(pI830->drmSubFD, ctxpriv->ssb_handle);
291 ctxpriv->ssb_handle = 0;
294 if (ctxpriv->msb_handle) {
295 drmRmMap(pI830->drmSubFD, ctxpriv->msb_handle);
296 ctxpriv->msb_handle = 0;
299 if (ctxpriv->psp_handle) {
300 drmRmMap(pI830->drmSubFD, ctxpriv->psp_handle);
301 ctxpriv->psp_handle = 0;
304 if (ctxpriv->psc_handle) {
305 drmRmMap(pI830->drmSubFD, ctxpriv->psc_handle);
306 ctxpriv->psc_handle = 0;
309 if (ctxpriv->corrdata_handle) {
310 drmRmMap(pI830->drmSubFD, ctxpriv->corrdata_handle);
311 ctxpriv->corrdata_handle = 0;
316 static Bool i915_allocate_xvmc_buffers(ScrnInfoPtr pScrn, I915XvMCContextPriv *ctxpriv)
326 &(ctxpriv->mcStaticIndirectState), 4 * 1024,
332 &(ctxpriv->mcSamplerState), 4 * 1024,
338 &(ctxpriv->mcMapState), 4 * 1024,
344 &(ctxpriv->mcPixelShaderProgram), 4 * 1024,
350 &(ctxpriv->mcPixelShaderConstants), 4 * 1024,
356 &(ctxpriv->mcCorrdata), 512 * 1024,
367 static void i915_free_xvmc_buffers(ScrnInfoPtr pScrn, I915XvMCContextPriv *ctxpriv)
369 if (ctxpriv->mcStaticIndirectState) {
370 i830_free_xvmc_buffer(pScrn, ctxpriv->mcStaticIndirectState);
371 ctxpriv->mcStaticIndirectState = NULL;
374 if (ctxpriv->mcSamplerState) {
375 i830_free_xvmc_buffer(pScrn, ctxpriv->mcSamplerState);
376 ctxpriv->mcSamplerState = NULL;
379 if (ctxpriv->mcMapState) {
380 i830_free_xvmc_buffer(pScrn, ctxpriv->mcMapState);
381 ctxpriv->mcMapState = NULL;
384 if (ctxpriv->mcPixelShaderProgram) {
385 i830_free_xvmc_buffer(pScrn, ctxpriv->mcPixelShaderProgram);
386 ctxpriv->mcPixelShaderProgram = NULL;
389 if (ctxpriv->mcPixelShaderConstants) {
390 i830_free_xvmc_buffer(pScrn, ctxpriv->mcPixelShaderConstants);
391 ctxpriv->mcPixelShaderConstants = NULL;
394 if (ctxpriv->mcCorrdata) {
395 i830_free_xvmc_buffer(pScrn, ctxpriv->mcCorrdata);
396 ctxpriv->mcCorrdata = NULL;
420 I915XvMCContextPriv *ctxpriv = NULL;
456 ctxpriv = (I915XvMCContextPriv *)xcalloc(1, sizeof(I915XvMCContextPriv));
458 if (!ctxpriv) {
467 if (!i915_allocate_xvmc_buffers(pScrn, ctxpriv)) {
468 i915_free_xvmc_buffers(pScrn, ctxpriv);
469 xfree(ctxpriv);
470 ctxpriv = NULL;
477 if (!i915_map_xvmc_buffers(pScrn, ctxpriv)) {
478 i915_unmap_xvmc_buffers(pScrn, ctxpriv);
479 i915_free_xvmc_buffers(pScrn, ctxpriv);
480 xfree(ctxpriv);
481 ctxpriv = NULL;
496 contextRec->sis.handle = ctxpriv->sis_handle;
497 contextRec->sis.offset = ctxpriv->mcStaticIndirectState->offset;
498 contextRec->sis.size = ctxpriv->mcStaticIndirectState->size;
499 contextRec->ssb.handle = ctxpriv->ssb_handle;
500 contextRec->ssb.offset = ctxpriv->mcSamplerState->offset;
501 contextRec->ssb.size = ctxpriv->mcSamplerState->size;
502 contextRec->msb.handle = ctxpriv->msb_handle;
503 contextRec->msb.offset = ctxpriv->mcMapState->offset;
504 contextRec->msb.size = ctxpriv->mcMapState->size;
505 contextRec->psp.handle = ctxpriv->psp_handle;
506 contextRec->psp.offset = ctxpriv->mcPixelShaderProgram->offset;
507 contextRec->psp.size = ctxpriv->mcPixelShaderProgram->size;
508 contextRec->psc.handle = ctxpriv->psc_handle;
509 contextRec->psc.offset = ctxpriv->mcPixelShaderConstants->offset;
510 contextRec->psc.size = ctxpriv->mcPixelShaderConstants->size;
511 contextRec->corrdata.handle = ctxpriv->corrdata_handle;
512 contextRec->corrdata.offset = ctxpriv->mcCorrdata->offset;
513 contextRec->corrdata.size = ctxpriv->mcCorrdata->size;
517 contextRec->sis.bus_addr = ctxpriv->mcStaticIndirectState->bus_addr;
518 contextRec->ssb.bus_addr = ctxpriv->mcSamplerState->bus_addr;
519 contextRec->msb.bus_addr = ctxpriv->mcMapState->bus_addr;
520 contextRec->psp.bus_addr = ctxpriv->mcPixelShaderProgram->bus_addr;
521 contextRec->psc.bus_addr = ctxpriv->mcPixelShaderConstants->bus_addr;
526 pXvMC->ctxprivs[i] = ctxpriv;