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

Commit 721b2a28 authored by Andy McFadden's avatar Andy McFadden Committed by Android Git Automerger
Browse files

am 8dfa92fe: Plumb display name into SurfaceFlinger

* commit '8dfa92fe':
  Plumb display name into SurfaceFlinger
parents e303e431 8dfa92fe
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -68,7 +68,7 @@ public:
    /* create a display
     * requires ACCESS_SURFACE_FLINGER permission.
     */
    virtual sp<IBinder> createDisplay() = 0;
    virtual sp<IBinder> createDisplay(const String8& displayName) = 0;

    /* get the token for the existing default displays. possible values
     * for id are eDisplayIdMain and eDisplayIdHdmi.
+1 −1
Original line number Diff line number Diff line
@@ -85,7 +85,7 @@ public:
    );

    //! Create a display
    static sp<IBinder> createDisplay();
    static sp<IBinder> createDisplay(const String8& displayName);

    //! Get the token for the existing default displays.
    //! Possible values for id are eDisplayIdMain and eDisplayIdHdmi.
+4 −2
Original line number Diff line number Diff line
@@ -179,10 +179,11 @@ public:
        return result;
    }

    virtual sp<IBinder> createDisplay()
    virtual sp<IBinder> createDisplay(const String8& displayName)
    {
        Parcel data, reply;
        data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
        data.writeString8(displayName);
        remote()->transact(BnSurfaceComposer::CREATE_DISPLAY, data, &reply);
        return reply.readStrongBinder();
    }
@@ -305,7 +306,8 @@ status_t BnSurfaceComposer::onTransact(
        } break;
        case CREATE_DISPLAY: {
            CHECK_INTERFACE(ISurfaceComposer, data, reply);
            sp<IBinder> display(createDisplay());
            String8 displayName = data.readString8();
            sp<IBinder> display(createDisplay(displayName));
            reply->writeStrongBinder(display);
            return NO_ERROR;
        } break;
+5 −5
Original line number Diff line number Diff line
@@ -128,7 +128,7 @@ class Composer : public Singleton<Composer>
    DisplayState& getDisplayStateLocked(const sp<IBinder>& token);

public:
    sp<IBinder> createDisplay();
    sp<IBinder> createDisplay(const String8& displayName);
    sp<IBinder> getBuiltInDisplay(int32_t id);

    status_t setPosition(const sp<SurfaceComposerClient>& client, SurfaceID id,
@@ -168,8 +168,8 @@ ANDROID_SINGLETON_STATIC_INSTANCE(Composer);

// ---------------------------------------------------------------------------

sp<IBinder> Composer::createDisplay() {
    return ComposerService::getComposerService()->createDisplay();
sp<IBinder> Composer::createDisplay(const String8& displayName) {
    return ComposerService::getComposerService()->createDisplay(displayName);
}

sp<IBinder> Composer::getBuiltInDisplay(int32_t id) {
@@ -442,8 +442,8 @@ sp<SurfaceControl> SurfaceComposerClient::createSurface(
    return result;
}

sp<IBinder> SurfaceComposerClient::createDisplay() {
    return Composer::getInstance().createDisplay();
sp<IBinder> SurfaceComposerClient::createDisplay(const String8& displayName) {
    return Composer::getInstance().createDisplay(displayName);
}

sp<IBinder> SurfaceComposerClient::getBuiltInDisplay(int32_t id) {
+14 −0
Original line number Diff line number Diff line
@@ -149,6 +149,20 @@ void DisplayDevice::init(EGLConfig config)
    // get an h/w composer ID
    mHwcDisplayId = mFlinger->allocateHwcDisplayId(mType);

    // Name the display.  The name will be replaced shortly if the display
    // was created with createDisplay().
    switch (mType) {
        case DISPLAY_PRIMARY:
            mDisplayName = "Built-in Screen";
            break;
        case DISPLAY_EXTERNAL:
            mDisplayName = "HDMI Screen";
            break;
        default:
            mDisplayName = "Virtual Screen";    // e.g. Overlay #n
            break;
    }

    // initialize the display orientation transform.
    setProjection(DisplayState::eOrientationDefault, mViewport, mFrame);
}
Loading