diff options
author | Sean Paul <seanpaul@chromium.org> | 2015-10-21 20:05:05 -0400 |
---|---|---|
committer | Sean Paul <seanpaul@chromium.org> | 2015-10-21 20:05:05 -0400 |
commit | 6f82f1d69d1194ee43dd9f36c0314afb6634cbbb (patch) | |
tree | dbda57d26d0b6417c308e5f28df9025b3fa90159 /hwcomposer.cpp | |
parent | e7eff73fb428d53c5488ef470d9e401949eb1b00 (diff) | |
download | drm_hwcomposer-6f82f1d69d1194ee43dd9f36c0314afb6634cbbb.tar.gz |
drm_hwcomposer: Remove hwc.drm.use_framebuffer_target property
Remove the redundant property hwc.drm.use_framebuffer_target from
drm_hwcomposer. The same can be achieved by using the "Disable HW
overlays" toggle in Developer Options.
Change-Id: I3283a8931d84113d8dc63cc818598a7f9556a171
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Diffstat (limited to 'hwcomposer.cpp')
-rw-r--r-- | hwcomposer.cpp | 48 |
1 files changed, 13 insertions, 35 deletions
diff --git a/hwcomposer.cpp b/hwcomposer.cpp index 31cbada..f1d6fbb 100644 --- a/hwcomposer.cpp +++ b/hwcomposer.cpp @@ -130,7 +130,7 @@ struct hwc_context_t { typedef std::map<int, hwc_drm_display_t> DisplayMap; typedef DisplayMap::iterator DisplayMapIter; - hwc_context_t() : procs(NULL), importer(NULL), use_framebuffer_target(false) { + hwc_context_t() : procs(NULL), importer(NULL) { } ~hwc_context_t() { @@ -146,7 +146,6 @@ struct hwc_context_t { Importer *importer; const gralloc_module_t *gralloc; DummySwSyncTimeline dummy_timeline; - bool use_framebuffer_target; VirtualCompositorWorker virtual_compositor_worker; }; @@ -339,19 +338,11 @@ static int hwc_prepare(hwc_composer_device_1_t *dev, size_t num_displays, hwc_display_contents_1_t **display_contents) { struct hwc_context_t *ctx = (struct hwc_context_t *)&dev->common; - char use_framebuffer_target[PROPERTY_VALUE_MAX]; - property_get("hwc.drm.use_framebuffer_target", use_framebuffer_target, "0"); - bool new_use_framebuffer_target = atoi(use_framebuffer_target); - if (ctx->use_framebuffer_target != new_use_framebuffer_target) - ALOGW("Starting to %s HWC_FRAMEBUFFER_TARGET", - new_use_framebuffer_target ? "use" : "not use"); - ctx->use_framebuffer_target = new_use_framebuffer_target; - for (int i = 0; i < (int)num_displays; ++i) { if (!display_contents[i]) continue; - bool use_framebuffer_target = ctx->use_framebuffer_target; + bool use_framebuffer_target = false; if (i == HWC_DISPLAY_VIRTUAL) { use_framebuffer_target = true; } else { @@ -449,15 +440,10 @@ static int hwc_set(hwc_composer_device_1_t *dev, size_t num_displays, if (sf_layer->flags & HWC_SKIP_LAYER) continue; - if (!ctx->use_framebuffer_target) { - if (sf_layer->compositionType == HWC_OVERLAY) - indices_to_composite.push_back(j); - if (sf_layer->compositionType == HWC_FRAMEBUFFER_TARGET) - framebuffer_target_index = j; - } else { - if (sf_layer->compositionType == HWC_FRAMEBUFFER_TARGET) - indices_to_composite.push_back(j); - } + if (sf_layer->compositionType == HWC_OVERLAY) + indices_to_composite.push_back(j); + if (sf_layer->compositionType == HWC_FRAMEBUFFER_TARGET) + framebuffer_target_index = j; layer.acquire_fence.Set(sf_layer->acquireFenceFd); sf_layer->acquireFenceFd = -1; @@ -472,23 +458,15 @@ static int hwc_set(hwc_composer_device_1_t *dev, size_t num_displays, layer.release_fence = OutputFd(&sf_layer->releaseFenceFd); } - if (ctx->use_framebuffer_target) { - if (indices_to_composite.size() != 1) { - ALOGE("Expected 1 (got %d) layer with HWC_FRAMEBUFFER_TARGET", - indices_to_composite.size()); + if (indices_to_composite.empty() && framebuffer_target_index >= 0) { + hwc_layer_1_t *sf_layer = &dc->hwLayers[framebuffer_target_index]; + if (!sf_layer->handle || (sf_layer->flags & HWC_SKIP_LAYER)) { + ALOGE( + "Expected valid layer with HWC_FRAMEBUFFER_TARGET when all " + "HWC_OVERLAY layers are skipped."); ret = -EINVAL; } - } else { - if (indices_to_composite.empty() && framebuffer_target_index >= 0) { - hwc_layer_1_t *sf_layer = &dc->hwLayers[framebuffer_target_index]; - if (!sf_layer->handle || (sf_layer->flags & HWC_SKIP_LAYER)) { - ALOGE( - "Expected valid layer with HWC_FRAMEBUFFER_TARGET when all " - "HWC_OVERLAY layers are skipped."); - ret = -EINVAL; - } - indices_to_composite.push_back(framebuffer_target_index); - } + indices_to_composite.push_back(framebuffer_target_index); } } |