intel->dri2Enabled = (dri_state->driConnectedFlag == VA_DRI2);
if (!intel->dri2Enabled) {
- drm_sarea_t *pSAREA;
-
- pSAREA = (drm_sarea_t *)dri_state->pSAREA;
- intel->hHWContext = dri_state->hwContext;
- intel->driHwLock = (drmLock *)(&pSAREA->lock);
- intel->pPrivSarea = (void *)pSAREA + sizeof(drm_sarea_t);
+ return False;
}
intel->locked = 0;
return True;
}
-
-void
-intel_lock_hardware(VADriverContextP ctx)
-{
- struct intel_driver_data *intel = intel_driver_data(ctx);
- char __ret = 0;
-
- PPTHREAD_MUTEX_LOCK();
-
- assert(!intel->locked);
-
- if (!intel->dri2Enabled) {
- DRM_CAS(intel->driHwLock,
- intel->hHWContext,
- (DRM_LOCK_HELD|intel->hHWContext),
- __ret);
-
- if (__ret) {
- drmGetLock(intel->fd, intel->hHWContext, 0);
- }
- }
-
- intel->locked = 1;
-}
-
-void
-intel_unlock_hardware(VADriverContextP ctx)
-{
- struct intel_driver_data *intel = intel_driver_data(ctx);
-
- if (!intel->dri2Enabled) {
- DRM_UNLOCK(intel->fd,
- intel->driHwLock,
- intel->hHWContext);
- }
-
- intel->locked = 0;
- PPTHREAD_MUTEX_UNLOCK();
-}
#include <pthread.h>
#include <signal.h>
-#include <xf86drm.h>
#include <drm.h>
#include <i915_drm.h>
#include <intel_bufmgr.h>
int device_id;
int dri2Enabled;
- drm_context_t hHWContext;
- drm_i915_sarea_t *pPrivSarea;
- drmLock *driHwLock;
sigset_t sa_mask;
pthread_mutex_t ctxmutex;
Bool intel_driver_init(VADriverContextP ctx);
Bool intel_driver_terminate(VADriverContextP ctx);
-void intel_lock_hardware(VADriverContextP ctx);
-void intel_unlock_hardware(VADriverContextP ctx);
static INLINE struct intel_driver_data *
intel_driver_data(VADriverContextP ctx)