Home | History | Annotate | Download | only in libhwcomposer

Lines Matching full:ctx

47 static int openFramebufferDevice(hwc_context_t *ctx)
90 ctx->dpyAttr[HWC_DISPLAY_PRIMARY].fd = fb_fd;
92 ctx->dpyAttr[HWC_DISPLAY_PRIMARY].stride = finfo.line_length /(info.xres/8);
93 ctx->dpyAttr[HWC_DISPLAY_PRIMARY].xres = info.xres;
94 ctx->dpyAttr[HWC_DISPLAY_PRIMARY].yres = info.yres;
95 ctx->dpyAttr[HWC_DISPLAY_PRIMARY].xdpi = xdpi;
96 ctx->dpyAttr[HWC_DISPLAY_PRIMARY].ydpi = ydpi;
97 ctx->dpyAttr[HWC_DISPLAY_PRIMARY].vsync_period = 1000000000l / fps;
104 ctx->dpyAttr[HWC_DISPLAY_PRIMARY].isActive = true;
109 static int ppdComm(const char* cmd, hwc_context_t *ctx) {
111 ret = write(ctx->mCablProp.daemon_socket, cmd, strlen(cmd));
121 static void connectPPDaemon(hwc_context_t *ctx)
128 ctx->mCablProp.enabled = true;
131 ctx->mCablProp.enabled = false;
138 ctx->mCablProp.videoOnly = true;
140 ctx->mCablProp.videoOnly = false;
148 ctx->mCablProp.enabled = false;
151 ctx->mCablProp.daemon_socket = daemon_socket;
154 void initContext(hwc_context_t *ctx)
156 if(openFramebufferDevice(ctx) < 0) {
161 ctx->mOverlay = overlay::Overlay::getInstance();
162 ctx->mRotMgr = new RotMgr();
163 ctx->mMDP.version = qdutils::MDPVersion::getInstance().getMDPVersion();
164 ctx->mMDP.hasOverlay = qdutils::MDPVersion::getInstance().hasOverlay();
165 ctx->mMDP.panel = qdutils::MDPVersion::getInstance().getPanelType();
167 ctx->mOverlay = overlay::Overlay::getInstance();
168 ctx->mRotMgr = new RotMgr();
173 ctx->mFBUpdate[HWC_DISPLAY_PRIMARY] =
174 IFBUpdate::getObject(ctx->dpyAttr[HWC_DISPLAY_PRIMARY].xres,
185 ctx->mCopyBit[HWC_DISPLAY_PRIMARY] = new CopyBit();
188 ctx->mExtDisplay = new ExternalDisplay(ctx);
191 ctx->mLayerRotMap[i] = new LayerRotMap();
194 ctx->mMDPComp[HWC_DISPLAY_PRIMARY] =
195 MDPComp::getObject(ctx->dpyAttr[HWC_DISPLAY_PRIMARY].xres,
198 MDPComp::init(ctx);
200 ctx->vstate.enable = false;
201 ctx->vstate.fakevsync = false;
202 ctx->mExtDispConfiguring = false;
203 ctx->mBasePipeSetup = false;
208 sp<IQClient> client = new QClient(ctx);
214 ALOGI("MDP version: %d", ctx->mMDP.version);
216 connectPPDaemon(ctx);
219 void closeContext(hwc_context_t *ctx)
221 if(ctx->mOverlay) {
222 delete ctx->mOverlay;
223 ctx->mOverlay = NULL;
226 if(ctx->mRotMgr) {
227 delete ctx->mRotMgr;
228 ctx->mRotMgr = NULL;
232 if(ctx->mCopyBit[i]) {
233 delete ctx->mCopyBit[i];
234 ctx->mCopyBit[i] = NULL;
238 if(ctx->dpyAttr[HWC_DISPLAY_PRIMARY].fd) {
239 close(ctx->dpyAttr[HWC_DISPLAY_PRIMARY].fd);
240 ctx->dpyAttr[HWC_DISPLAY_PRIMARY].fd = -1;
243 if(ctx->mExtDisplay) {
244 delete ctx->mExtDisplay;
245 ctx->mExtDisplay = NULL;
249 if(ctx->mFBUpdate[i]) {
250 delete ctx->mFBUpdate[i];
251 ctx->mFBUpdate[i] = NULL;
253 if(ctx->mMDPComp[i]) {
254 delete ctx->mMDPComp[i];
255 ctx->mMDPComp[i] = NULL;
257 if(ctx->mLayerRotMap[i]) {
258 delete ctx->mLayerRotMap[i];
259 ctx->mLayerRotMap[i] = NULL;
274 void getActionSafePosition(hwc_context_t *ctx, int dpy, uint32_t& x,
279 if(ctx->mExtDisplay->isCEUnderscanSupported())
287 float fbWidth = ctx->dpyAttr[dpy].xres;
288 float fbHeight = ctx->dpyAttr[dpy].yres;
363 static void setYUVProp(hwc_context_t *ctx, int yuvCount) {
364 if (!ctx->mCablProp.enabled)
367 if (yuvCount > 0 && !ctx->mCablProp.start) {
368 ctx->mCablProp.start = true;
369 if(ctx->mCablProp.videoOnly)
370 ppdComm("cabl:on", ctx);
372 ppdComm("cabl:yuv_on", ctx);
374 } else if (yuvCount == 0 && ctx->mCablProp.start) {
375 ctx->mCablProp.start = false;
376 if(ctx->mCablProp.videoOnly)
377 ppdComm("cabl:off", ctx);
379 ppdComm("cabl:yuv_off", ctx);
384 void setListStats(hwc_context_t *ctx,
387 ctx->listStats[dpy].numAppLayers = list->numHwLayers - 1;
388 ctx->listStats[dpy].fbLayerIndex = list->numHwLayers - 1;
389 ctx->listStats[dpy].skipCount = 0;
390 ctx->listStats[dpy].needsAlphaScale = false;
391 ctx->listStats[dpy].preMultipliedAlpha = false;
392 ctx->listStats[dpy].planeAlpha = false;
393 ctx->listStats[dpy].yuvCount = 0;
400 ctx->listStats[dpy].yuvIndices[i] = -1;
406 ctx->listStats[dpy].skipCount++;
408 int& yuvCount = ctx->listStats[dpy].yuvCount;
409 ctx->listStats[dpy].yuvIndices[yuvCount] = i;
413 ctx->mNeedsRotator = true;
416 ctx->listStats[dpy].preMultipliedAlpha = true;
418 ctx->listStats[dpy].planeAlpha = true;
419 if(!ctx->listStats[dpy].needsAlphaScale)
420 ctx->listStats[dpy].needsAlphaScale = isAlphaScaled(layer);
422 setYUVProp(ctx, ctx->listStats[dpy].yuvCount);
444 bool isSecuring(hwc_context_t* ctx, hwc_layer_1_t const* layer) {
445 if((ctx->mMDP.version < qdutils::MDSS_V5) &&
446 (ctx->mMDP.version > qdutils::MDP_V3_0) &&
447 ctx->mSecuring) {
452 if (isSecureModePolicy(ctx->mMDP.version)) {
454 if(ctx->mSecureMode) {
585 bool isExternalActive(hwc_context_t* ctx) {
586 return ctx->dpyAttr[HWC_DISPLAY_EXTERNAL].isActive;
602 int hwc_sync(hwc_context_t *ctx, hwc_display_contents_1_t* list, int dpy,
633 int rotFd = ctx->mRotMgr->getRotDevFd();
636 for(uint32_t i = 0; i < ctx->mLayerRotMap[dpy]->getCount(); i++) {
639 ctx->mLayerRotMap[dpy]->getLayer(i)->acquireFenceFd;
641 rotData.session_id = ctx->mLayerRotMap[dpy]->getRot(i)->getSessId();
648 ctx->mLayerRotMap[dpy]->getLayer(i)->releaseFenceFd =
680 fbFd = ctx->dpyAttr[dpy].fd;
713 if (ctx->mCopyBit[dpy])
714 ctx->mCopyBit[dpy]->setReleaseFd(releaseFd);
719 ctx->mLayerRotMap[dpy]->setReleaseFd(releaseFd);
732 void trimLayer(hwc_context_t *ctx, const int& dpy, const int& transform,
734 int hw_w = ctx->dpyAttr[dpy].xres;
735 int hw_h = ctx->dpyAttr[dpy].yres;
807 bool setupBasePipe(hwc_context_t *ctx) {
809 int fb_stride = ctx->dpyAttr[dpy].stride;
810 int fb_width = ctx->dpyAttr[dpy].xres;
811 int fb_height = ctx->dpyAttr[dpy].yres;
812 int fb_fd = ctx->dpyAttr[dpy].fd;
840 ctx->mBasePipeSetup = true;
886 int configureLowRes(hwc_context_t *ctx, hwc_layer_1_t *layer,
907 if(isYuvBuffer(hnd) && ctx->mMDP.version >= qdutils::MDP_V4_2 &&
908 ctx->mMDP.version < qdutils::MDSS_V5) {
920 trimLayer(ctx, dpy, transform, crop, dst);
924 *rot = ctx->mRotMgr->getNext();
929 ctx->mLayerRotMap[dpy]->add(layer, *rot);
943 if(configMdp(ctx->mOverlay, parg, orient, crop, dst, metadata, dest) < 0) {
945 ctx->mLayerRotMap[dpy]->reset();
951 int configureHighRes(hwc_context_t *ctx, hwc_layer_1_t *layer,
963 int hw_w = ctx->dpyAttr[dpy].xres;
964 int hw_h = ctx->dpyAttr[dpy].yres;
976 trimLayer(ctx, dpy, transform, crop, dst);
979 (*rot) = ctx->mRotMgr->getNext();
984 ctx->mLayerRotMap[dpy]->add(layer, *rot);
1040 if(configMdp(ctx->mOverlay, pargL, orient,
1055 if(configMdp(ctx->mOverlay, pargR, orient,