Lines Matching refs:st

40 #define EGC_LOGV(x, ...) ALOGV("[%s] " x, st.mName.string(), ##__VA_ARGS__)
41 #define EGC_LOGD(x, ...) ALOGD("[%s] " x, st.mName.string(), ##__VA_ARGS__)
42 #define EGC_LOGW(x, ...) ALOGW("[%s] " x, st.mName.string(), ##__VA_ARGS__)
43 #define EGC_LOGE(x, ...) ALOGE("[%s] " x, st.mName.string(), ##__VA_ARGS__)
87 status_t EGLConsumer::updateTexImage(SurfaceTexture& st) { in updateTexImage() argument
89 status_t err = checkAndUpdateEglStateLocked(st); in updateTexImage()
99 err = st.acquireBufferLocked(&item, 0); in updateTexImage()
104 glBindTexture(st.mTexTarget, st.mTexName); in updateTexImage()
113 err = updateAndReleaseLocked(item, nullptr, st); in updateTexImage()
116 glBindTexture(st.mTexTarget, st.mTexName); in updateTexImage()
121 return bindTextureImageLocked(st); in updateTexImage()
124 status_t EGLConsumer::releaseTexImage(SurfaceTexture& st) { in releaseTexImage() argument
129 if (st.mOpMode == SurfaceTexture::OpMode::attachedToGL) { in releaseTexImage()
130 err = checkAndUpdateEglStateLocked(st, true); in releaseTexImage()
137 int buf = st.mCurrentTexture; in releaseTexImage()
139 EGC_LOGV("releaseTexImage: (slot=%d, mOpMode=%d)", buf, (int)st.mOpMode); in releaseTexImage()
143 if (st.mOpMode == SurfaceTexture::OpMode::attachedToGL) { in releaseTexImage()
145 err = syncForReleaseLocked(mEglDisplay, st); in releaseTexImage()
152 err = st.releaseBufferLocked(buf, st.mSlots[buf].mGraphicBuffer, mEglDisplay, in releaseTexImage()
163 st.mCurrentTexture = BufferQueue::INVALID_BUFFER_SLOT; in releaseTexImage()
165 st.mCurrentCrop.makeInvalid(); in releaseTexImage()
166 st.mCurrentTransform = 0; in releaseTexImage()
167 st.mCurrentTimestamp = 0; in releaseTexImage()
168 st.mCurrentDataSpace = HAL_DATASPACE_UNKNOWN; in releaseTexImage()
169 st.mCurrentFence = Fence::NO_FENCE; in releaseTexImage()
170 st.mCurrentFenceTime = FenceTime::NO_FENCE; in releaseTexImage()
174 if (st.mOpMode == SurfaceTexture::OpMode::attachedToGL) { in releaseTexImage()
176 status_t result = bindTextureImageLocked(st); in releaseTexImage()
212 void EGLConsumer::onAcquireBufferLocked(BufferItem* item, SurfaceTexture& st) { in onAcquireBufferLocked() argument
218 mEglSlots[slot].mEglImage = new EglImage(st.mSlots[slot].mGraphicBuffer); in onAcquireBufferLocked()
227 SurfaceTexture& st) { in updateAndReleaseLocked() argument
232 if (st.mOpMode != SurfaceTexture::OpMode::attachedToGL) { in updateAndReleaseLocked()
236 st.releaseBufferLocked(slot, st.mSlots[slot].mGraphicBuffer, mEglDisplay, EGL_NO_SYNC_KHR); in updateAndReleaseLocked()
241 err = checkAndUpdateEglStateLocked(st); in updateAndReleaseLocked()
243 st.releaseBufferLocked(slot, st.mSlots[slot].mGraphicBuffer, mEglDisplay, EGL_NO_SYNC_KHR); in updateAndReleaseLocked()
256 st.releaseBufferLocked(slot, st.mSlots[slot].mGraphicBuffer, mEglDisplay, EGL_NO_SYNC_KHR); in updateAndReleaseLocked()
261 if (slot != st.mCurrentTexture) { in updateAndReleaseLocked()
262 err = syncForReleaseLocked(mEglDisplay, st); in updateAndReleaseLocked()
268 st.releaseBufferLocked(slot, st.mSlots[slot].mGraphicBuffer, mEglDisplay, in updateAndReleaseLocked()
275 "updateAndRelease: (slot=%d buf=%p) -> (slot=%d buf=%p)", st.mCurrentTexture, in updateAndReleaseLocked()
277 slot, st.mSlots[slot].mGraphicBuffer->handle); in updateAndReleaseLocked()
285 if (st.mCurrentTexture != BufferQueue::INVALID_BUFFER_SLOT) { in updateAndReleaseLocked()
287 status_t status = st.releaseBufferLocked( in updateAndReleaseLocked()
288 st.mCurrentTexture, mCurrentTextureImage->graphicBuffer(), mEglDisplay, in updateAndReleaseLocked()
289 mEglSlots[st.mCurrentTexture].mEglFence); in updateAndReleaseLocked()
297 pendingRelease->currentTexture = st.mCurrentTexture; in updateAndReleaseLocked()
300 pendingRelease->fence = mEglSlots[st.mCurrentTexture].mEglFence; in updateAndReleaseLocked()
306 st.mCurrentTexture = slot; in updateAndReleaseLocked()
308 st.mCurrentCrop = item.mCrop; in updateAndReleaseLocked()
309 st.mCurrentTransform = item.mTransform; in updateAndReleaseLocked()
310 st.mCurrentScalingMode = item.mScalingMode; in updateAndReleaseLocked()
311 st.mCurrentTimestamp = item.mTimestamp; in updateAndReleaseLocked()
312 st.mCurrentDataSpace = item.mDataSpace; in updateAndReleaseLocked()
313 st.mCurrentFence = item.mFence; in updateAndReleaseLocked()
314 st.mCurrentFenceTime = item.mFenceTime; in updateAndReleaseLocked()
315 st.mCurrentFrameNumber = item.mFrameNumber; in updateAndReleaseLocked()
317 st.computeCurrentTransformMatrixLocked(); in updateAndReleaseLocked()
322 status_t EGLConsumer::bindTextureImageLocked(SurfaceTexture& st) { in bindTextureImageLocked() argument
333 glBindTexture(st.mTexTarget, st.mTexName); in bindTextureImageLocked()
334 if (st.mCurrentTexture == BufferQueue::INVALID_BUFFER_SLOT && mCurrentTextureImage == nullptr) { in bindTextureImageLocked()
342 st.mCurrentTexture); in bindTextureImageLocked()
345 mCurrentTextureImage->bindToTextureTarget(st.mTexTarget); in bindTextureImageLocked()
352 glBindTexture(st.mTexTarget, st.mTexName); in bindTextureImageLocked()
356 st.mCurrentTexture); in bindTextureImageLocked()
359 mCurrentTextureImage->bindToTextureTarget(st.mTexTarget); in bindTextureImageLocked()
367 return doGLFenceWaitLocked(st); in bindTextureImageLocked()
370 status_t EGLConsumer::checkAndUpdateEglStateLocked(SurfaceTexture& st, bool contextCheck) { in checkAndUpdateEglStateLocked() argument
400 status_t EGLConsumer::detachFromContext(SurfaceTexture& st) { in detachFromContext() argument
415 status_t err = syncForReleaseLocked(dpy, st); in detachFromContext()
420 glDeleteTextures(1, &st.mTexName); in detachFromContext()
429 status_t EGLConsumer::attachToContext(uint32_t tex, SurfaceTexture& st) { in attachToContext() argument
431 int slot = st.mCurrentTexture; in attachToContext()
434 mEglSlots[slot].mEglImage = new EglImage(st.mSlots[slot].mGraphicBuffer); in attachToContext()
454 glBindTexture(st.mTexTarget, GLuint(tex)); in attachToContext()
458 st.mTexName = tex; in attachToContext()
459 st.mOpMode = SurfaceTexture::OpMode::attachedToGL; in attachToContext()
466 status_t err = bindTextureImageLocked(st); in attachToContext()
475 status_t EGLConsumer::syncForReleaseLocked(EGLDisplay dpy, SurfaceTexture& st) { in syncForReleaseLocked() argument
478 if (st.mCurrentTexture != BufferQueue::INVALID_BUFFER_SLOT) { in syncForReleaseLocked()
496 status_t err = st.addReleaseFenceLocked(st.mCurrentTexture, in syncForReleaseLocked()
505 } else if (st.mUseFenceSync && SyncFeatures::getInstance().useFenceSync()) { in syncForReleaseLocked()
506 EGLSyncKHR fence = mEglSlots[st.mCurrentTexture].mEglFence; in syncForReleaseLocked()
536 mEglSlots[st.mCurrentTexture].mEglFence = fence; in syncForReleaseLocked()
543 status_t EGLConsumer::doGLFenceWaitLocked(SurfaceTexture& st) const { in doGLFenceWaitLocked()
557 if (st.mCurrentFence->isValid()) { in doGLFenceWaitLocked()
561 int fenceFd = st.mCurrentFence->dup(); in doGLFenceWaitLocked()
585 status_t err = st.mCurrentFence->waitForever("EGLConsumer::doGLFenceWaitLocked"); in doGLFenceWaitLocked()