intel_lock.c File Reference

Include dependency graph for intel_lock.c:

Go to the source code of this file.

Functions

 pipe_static_mutex (lockMutex)
static void intelContendedLock (struct intel_context *intel, uint flags)
void LOCK_HARDWARE (struct intel_context *intel)
void UNLOCK_HARDWARE (struct intel_context *intel)


Function Documentation

static void intelContendedLock ( struct intel_context intel,
uint  flags 
) [static]

Definition at line 42 of file intel_lock.c.

References __progname, DBG, intel_context::driDrawable, intel_context::driFd, intel_context::driScreen, intel_screen::front, intel_screen::height, drmI830Sarea::height, intel_context::hHWContext, intel_screen(), intelUpdateScreenRotation(), intel_context::sarea, intel_screen::sarea, intel_screen::width, and drmI830Sarea::width.

00043 {
00044    __DRIdrawablePrivate *dPriv = intel->driDrawable;
00045    __DRIscreenPrivate *sPriv = intel->driScreen;
00046    struct intel_screen *intelScreen = intel_screen(sPriv);
00047    drmI830Sarea *sarea = intel->sarea;
00048 
00049    drmGetLock(intel->driFd, intel->hHWContext, flags);
00050 
00051    DBG(LOCK, "%s - got contended lock\n", __progname);
00052 
00053    /* If the window moved, may need to set a new cliprect now.
00054     *
00055     * NOTE: This releases and regains the hw lock, so all state
00056     * checking must be done *after* this call:
00057     */
00058    if (dPriv)
00059       DRI_VALIDATE_DRAWABLE_INFO(sPriv, dPriv);
00060 
00061    if (sarea->width != intelScreen->front.width ||
00062        sarea->height != intelScreen->front.height) {
00063 
00064       intelUpdateScreenRotation(sPriv, sarea);
00065    }
00066 }

void LOCK_HARDWARE ( struct intel_context intel  ) 

Definition at line 71 of file intel_lock.c.

References __progname, assert, DBG, intel_context::driHwLock, intel_context::hHWContext, intelContendedLock(), intel_context::locked, and pipe_mutex_lock.

00072 {
00073     char __ret = 0;
00074 
00075     pipe_mutex_lock(lockMutex);
00076     assert(!intel->locked);
00077 
00078     DRM_CAS(intel->driHwLock, intel->hHWContext,
00079             (DRM_LOCK_HELD|intel->hHWContext), __ret);
00080 
00081     if (__ret)
00082        intelContendedLock( intel, 0 );
00083 
00084     DBG(LOCK, "%s - locked\n", __progname);
00085 
00086     intel->locked = 1;
00087 }

pipe_static_mutex ( lockMutex   ) 

void UNLOCK_HARDWARE ( struct intel_context intel  ) 

Definition at line 92 of file intel_lock.c.

References __progname, assert, DBG, intel_context::driFd, intel_context::driHwLock, intel_context::hHWContext, intel_context::locked, and pipe_mutex_unlock.

00093 {
00094    assert(intel->locked);
00095    intel->locked = 0;
00096 
00097    DRM_UNLOCK(intel->driFd, intel->driHwLock, intel->hHWContext);
00098 
00099    pipe_mutex_unlock(lockMutex);
00100 
00101    DBG(LOCK, "%s - unlocked\n", __progname);
00102 }


Generated on Tue Sep 29 06:25:46 2009 for Gallium3D by  doxygen 1.5.4