Lines Matching refs:disp
174 DisplayData& disp(mDisplayData[HWC_DISPLAY_PRIMARY]);
175 disp.connected = true;
176 disp.width = mFbDev->width;
177 disp.height = mFbDev->height;
178 disp.format = mFbDev->format;
179 disp.xdpi = mFbDev->xdpi;
180 disp.ydpi = mFbDev->ydpi;
181 if (disp.refresh == 0) {
182 disp.refresh = nsecs_t(1e9 / mFbDev->fps);
183 ALOGW("getting VSYNC period from fb HAL: %lld", disp.refresh);
185 if (disp.refresh == 0) {
186 disp.refresh = nsecs_t(1e9 / 60.0);
271 void HWComposer::hook_vsync(const struct hwc_procs* procs, int disp,
275 ctx->hwc->vsync(disp, timestamp);
278 void HWComposer::hook_hotplug(const struct hwc_procs* procs, int disp,
282 ctx->hwc->hotplug(disp, connected);
289 void HWComposer::vsync(int disp, int64_t timestamp) {
291 mEventHandler.onVSyncReceived(disp, timestamp);
296 void HWComposer::hotplug(int disp, int connected) {
297 if (disp == HWC_DISPLAY_PRIMARY || disp >= VIRTUAL_DISPLAY_ID_BASE) {
298 ALOGE("hotplug event received for invalid display: disp=%d connected=%d",
299 disp, connected);
302 queryDisplayProperties(disp);
303 mEventHandler.onHotplugReceived(disp, bool(connected));
321 status_t HWComposer::queryDisplayProperties(int disp) {
331 status_t err = mHwc->getDisplayConfigs(mHwc, disp, &config, &numConfigs);
334 mDisplayData[disp].connected = false;
338 err = mHwc->getDisplayAttributes(mHwc, disp, config, DISPLAY_ATTRIBUTES, values);
341 mDisplayData[disp].connected = false;
349 mDisplayData[disp].refresh = nsecs_t(values[i]);
352 mDisplayData[disp].width = values[i];
355 mDisplayData[disp].height = values[i];
358 mDisplayData[disp].xdpi = values[i] / 1000.0f;
361 mDisplayData[disp].ydpi = values[i] / 1000.0f;
371 mDisplayData[disp].format = HAL_PIXEL_FORMAT_RGBA_8888;
372 mDisplayData[disp].connected = true;
373 if (mDisplayData[disp].xdpi == 0.0f || mDisplayData[disp].ydpi == 0.0f) {
375 mDisplayData[disp].xdpi = dpi;
376 mDisplayData[disp].ydpi = dpi;
417 nsecs_t HWComposer::getRefreshPeriod(int disp) const {
418 return mDisplayData[disp].refresh;
421 nsecs_t HWComposer::getRefreshTimestamp(int disp) const {
427 return now - ((now - mLastHwVSync) % mDisplayData[disp].refresh);
430 sp<Fence> HWComposer::getDisplayFence(int disp) const {
431 return mDisplayData[disp].lastDisplayFence;
434 uint32_t HWComposer::getWidth(int disp) const {
435 return mDisplayData[disp].width;
438 uint32_t HWComposer::getHeight(int disp) const {
439 return mDisplayData[disp].height;
442 uint32_t HWComposer::getFormat(int disp) const {
443 return mDisplayData[disp].format;
446 float HWComposer::getDpiX(int disp) const {
447 return mDisplayData[disp].xdpi;
450 float HWComposer::getDpiY(int disp) const {
451 return mDisplayData[disp].ydpi;
454 bool HWComposer::isConnected(int disp) const {
455 return mDisplayData[disp].connected;
458 void HWComposer::eventControl(int disp, int event, int enabled) {
459 if (uint32_t(disp)>31 || !mAllocatedDisplayIDs.hasBit(disp)) {
460 ALOGD("eventControl ignoring event %d on unallocated disp %d (en=%d)",
461 event, disp, enabled);
465 ALOGW("eventControl got unexpected event %d (disp=%d en=%d)",
466 event, disp, enabled);
478 const int32_t oldValue = mDisplayData[disp].events & eventBit;
481 err = mHwc->eventControl(mHwc, disp, event, enabled);
483 int32_t& events(mDisplayData[disp].events);
504 DisplayData& disp(mDisplayData[id]);
509 if (disp.capacity < numLayers || disp.list == NULL) {
512 free(disp.list);
513 disp.list = (hwc_display_contents_1_t*)malloc(size);
514 disp.capacity = numLayers;
517 disp.framebufferTarget = &disp.list->hwLayers[numLayers - 1];
518 memset(disp.framebufferTarget, 0, sizeof(hwc_layer_1_t));
519 const hwc_rect_t r = { 0, 0, (int) disp.width, (int) disp.height };
520 disp.framebufferTarget->compositionType = HWC_FRAMEBUFFER_TARGET;
521 disp.framebufferTarget->hints = 0;
522 disp.framebufferTarget->flags = 0;
523 disp.framebufferTarget->handle = disp.fbTargetHandle;
524 disp.framebufferTarget->transform = 0;
525 disp.framebufferTarget->blending = HWC_BLENDING_PREMULT;
526 disp.framebufferTarget->sourceCrop = r;
527 disp.framebufferTarget->displayFrame = r;
528 disp.framebufferTarget->visibleRegionScreen.numRects = 1;
529 disp.framebufferTarget->visibleRegionScreen.rects =
530 &disp.framebufferTarget->displayFrame;
531 disp.framebufferTarget->acquireFenceFd = -1;
532 disp.framebufferTarget->releaseFenceFd = -1;
533 disp.framebufferTarget->planeAlpha = 0xFF;
535 disp.list->retireFenceFd = -1;
536 disp.list->flags = HWC_GEOMETRY_CHANGED;
537 disp.list->numHwLayers = numLayers;
547 DisplayData& disp(mDisplayData[id]);
548 if (!disp.framebufferTarget) {
565 disp.fbTargetHandle = buf->handle;
566 disp.framebufferTarget->handle = disp.fbTargetHandle;
567 disp.framebufferTarget->acquireFenceFd = acquireFenceFd;
573 DisplayData& disp(mDisplayData[i]);
574 if (disp.framebufferTarget) {
579 LOG_FATAL_IF(disp.list == NULL);
580 disp.framebufferTarget->compositionType = HWC_FRAMEBUFFER_TARGET;
582 if (!disp.connected && disp.list != NULL) {
583 ALOGW("WARNING: disp %d: connected, non-null list, layers=%d",
584 i, disp.list->numHwLayers);
586 mLists[i] = disp.list;
610 DisplayData& disp(mDisplayData[i]);
611 disp.hasFbComp = false;
612 disp.hasOvComp = false;
613 if (disp.list) {
614 for (size_t i=0 ; i<disp.list->numHwLayers ; i++) {
615 hwc_layer_1_t& l = disp.list->hwLayers[i];
624 disp.hasFbComp = true;
627 disp.hasOvComp = true;
654 const DisplayData& disp(mDisplayData[id]);
655 if (disp.framebufferTarget) {
656 fd = disp.framebufferTarget->releaseFenceFd;
657 disp.framebufferTarget->acquireFenceFd = -1;
658 disp.framebufferTarget->releaseFenceFd = -1;
676 DisplayData& disp(mDisplayData[i]);
677 if (disp.outbufHandle) {
678 mLists[i]->outbuf = disp.outbufHandle;
680 disp.outbufAcquireFence->dup();
687 DisplayData& disp(mDisplayData[i]);
688 disp.lastDisplayFence = disp.lastRetireFence;
689 disp.lastRetireFence = Fence::NO_FENCE;
690 if (disp.list) {
691 if (disp.list->retireFenceFd != -1) {
692 disp.lastRetireFence = new Fence(disp.list->retireFenceFd);
693 disp.list->retireFenceFd = -1;
695 disp.list->flags &= ~HWC_GEOMETRY_CHANGED;
702 status_t HWComposer::release(int disp) {
703 LOG_FATAL_IF(disp >= VIRTUAL_DISPLAY_ID_BASE);
705 eventControl(disp, HWC_EVENT_VSYNC, 0);
706 return (status_t)mHwc->blank(mHwc, disp, 1);
711 status_t HWComposer::acquire(int disp) {
712 LOG_FATAL_IF(disp >= VIRTUAL_DISPLAY_ID_BASE);
714 return (status_t)mHwc->blank(mHwc, disp, 0);
719 void HWComposer::disconnectDisplay(int disp) {
720 LOG_ALWAYS_FATAL_IF(disp < 0 || disp == HWC_DISPLAY_PRIMARY);
721 DisplayData& dd(mDisplayData[disp]);
785 DisplayData& disp(mDisplayData[id]);
786 disp.outbufHandle = buf->handle;
787 disp.outbufAcquireFence = acquireFence;
929 const DisplayData& disp(mDisplayData[id]);
930 if (!mHwc || !disp.list || index > disp.list->numHwLayers) {
933 return LayerListIterator(new HWCLayerVersion1(mHwc, disp.list->hwLayers), index);
949 const DisplayData& disp(mDisplayData[id]);
950 if (mHwc && disp.list) {
951 numLayers = disp.list->numHwLayers;
970 const DisplayData& disp(mDisplayData[i]);
971 if (!disp.connected)
979 i, disp.width, disp.height, disp.xdpi, disp.ydpi, disp.refresh);
981 if (disp.list) {
984 disp.list->numHwLayers, disp.list->flags);
990 for (size_t i=0 ; i<disp.list->numHwLayers ; i++) {
991 const hwc_layer_1_t&l = disp.list->hwLayers[i];
1008 format = disp.format;