Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ae4ba606 authored by Dileep Marchya's avatar Dileep Marchya Committed by Linux Build Service Account
Browse files

This is a combination of two commits

sf: Correcting hardware acceleration for WFD

Hardware acceleration Virtual display debug property
implementation is updated for WFD cases

Change-Id: I61ad578919c034df3b7d7028925f2201b4131f24

surfaceflinger: Use /sys/class/graphics/fb* path for fb node access.

- /dev/graphics/fb* and /sys/class/graphics/fb* path do not have
  symbolic relation. /dev/graphics/fb* is deprecated. Accessing this
  path results in unpredictable behaviour.

CRs-Fixed: 1037552

Change-Id: I56cd8ea33153183ae93638153bb2fd6a9becdac0
parent 0e177a2a
Loading
Loading
Loading
Loading
+5 −6
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@
#include <stdlib.h>
#include <stdint.h>
#include <sys/types.h>
#include <unistd.h>

#include <utils/Errors.h>
#include <utils/Log.h>
@@ -174,10 +175,10 @@ bool DisplayUtils::canAllocateHwcDisplayIdForVDS(int usage) {

#if QTI_BSP
    // Do not allow hardware acceleration
    flag_mask = 0;
    flag_mask = GRALLOC_USAGE_PRIVATE_WFD;
#endif

    return mHasWbNode && (allowHwcForVDS || (usage & flag_mask));
    return ((mHasWbNode) && (!allowHwcForVDS) && (usage & flag_mask));
}

int DisplayUtils::getNumFbNodes() {
@@ -188,12 +189,10 @@ int DisplayUtils::getNumFbNodes() {

bool DisplayUtils::hasFbNode(int index) {
    char filename[kMaxStringLength];
    snprintf(filename, kMaxStringLength, "/dev/graphics/fb%d", index);
    int fd = open(filename, O_RDONLY);
    if (fd < 0) {
    snprintf(filename, kMaxStringLength, "/sys/class/graphics/fb%d", index);
    if (access(filename, F_OK) < 0) {
        return false;
    }
    close(fd);
    return true;
}