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

Commit c666cae2 authored by Mathias Agopian's avatar Mathias Agopian
Browse files

get rid of the shared-memory control block

Change-Id: If814060aca1d2ff2619d4adcd57296983d207f7f
parent 028508ca
Loading
Loading
Loading
Loading
+6 −4
Original line number Original line Diff line number Diff line
@@ -35,6 +35,7 @@ namespace android {


class ComposerState;
class ComposerState;
class DisplayState;
class DisplayState;
class DisplayInfo;
class IDisplayEventConnection;
class IDisplayEventConnection;
class IMemoryHeap;
class IMemoryHeap;


@@ -102,9 +103,6 @@ public:
     */
     */
    virtual sp<IGraphicBufferAlloc> createGraphicBufferAlloc() = 0;
    virtual sp<IGraphicBufferAlloc> createGraphicBufferAlloc() = 0;


    /* retrieve the control block */
    virtual sp<IMemoryHeap> getCblk() const = 0;

    /* open/close transactions. requires ACCESS_SURFACE_FLINGER permission */
    /* open/close transactions. requires ACCESS_SURFACE_FLINGER permission */
    virtual void setTransactionState(
    virtual void setTransactionState(
            const Vector<ComposerState>& state,
            const Vector<ComposerState>& state,
@@ -145,6 +143,10 @@ public:
    /* triggers screen on and waits for it to complete */
    /* triggers screen on and waits for it to complete */
    virtual void unblank() = 0;
    virtual void unblank() = 0;


    /* returns information about a physical screen. This is intended to be
     * used by low-level native tests */
    virtual status_t getDisplayInfo(DisplayID dpy, DisplayInfo* info) = 0;

    /* connects to an external display */
    /* connects to an external display */
    virtual void connectDisplay(const sp<ISurfaceTexture> display) = 0;
    virtual void connectDisplay(const sp<ISurfaceTexture> display) = 0;
};
};
@@ -160,7 +162,7 @@ public:
        BOOT_FINISHED = IBinder::FIRST_CALL_TRANSACTION,
        BOOT_FINISHED = IBinder::FIRST_CALL_TRANSACTION,
        CREATE_CONNECTION,
        CREATE_CONNECTION,
        CREATE_GRAPHIC_BUFFER_ALLOC,
        CREATE_GRAPHIC_BUFFER_ALLOC,
        GET_CBLK,
        GET_DISPLAY_INFO,
        SET_TRANSACTION_STATE,
        SET_TRANSACTION_STATE,
        SET_ORIENTATION,
        SET_ORIENTATION,
        CAPTURE_SCREEN,
        CAPTURE_SCREEN,
+0 −6
Original line number Original line Diff line number Diff line
@@ -97,14 +97,8 @@ public:
    //! Set the orientation of the given display
    //! Set the orientation of the given display
    static int setOrientation(DisplayID dpy, int orientation, uint32_t flags);
    static int setOrientation(DisplayID dpy, int orientation, uint32_t flags);


    // Query the number of displays
    static ssize_t getNumberOfDisplays();

    // Get information about a display
    // Get information about a display
    static status_t getDisplayInfo(DisplayID dpy, DisplayInfo* info);
    static status_t getDisplayInfo(DisplayID dpy, DisplayInfo* info);
    static ssize_t getDisplayWidth(DisplayID dpy);
    static ssize_t getDisplayHeight(DisplayID dpy);
    static ssize_t getDisplayOrientation(DisplayID dpy);


    status_t linkToComposerDeath(const sp<IBinder::DeathRecipient>& recipient,
    status_t linkToComposerDeath(const sp<IBinder::DeathRecipient>& recipient,
            void* cookie = NULL, uint32_t flags = 0);
            void* cookie = NULL, uint32_t flags = 0);
+0 −4
Original line number Original line Diff line number Diff line
@@ -30,7 +30,6 @@ namespace android {


class IMemoryHeap;
class IMemoryHeap;
class ISurfaceComposer;
class ISurfaceComposer;
class surface_flinger_cblk_t;


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


@@ -38,13 +37,10 @@ class ComposerService : public Singleton<ComposerService>
{
{
    // these are constants
    // these are constants
    sp<ISurfaceComposer> mComposerService;
    sp<ISurfaceComposer> mComposerService;
    sp<IMemoryHeap> mServerCblkMemory;
    surface_flinger_cblk_t volatile* mServerCblk;
    ComposerService();
    ComposerService();
    friend class Singleton<ComposerService>;
    friend class Singleton<ComposerService>;
public:
public:
    static sp<ISurfaceComposer> getComposerService();
    static sp<ISurfaceComposer> getComposerService();
    static surface_flinger_cblk_t const volatile * getControlBlock();
};
};


// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
+0 −59
Original line number Original line Diff line number Diff line
/*
 * Copyright (C) 2007 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef ANDROID_SF_SHARED_BUFFER_STACK_H
#define ANDROID_SF_SHARED_BUFFER_STACK_H

#include <stdint.h>
#include <sys/types.h>

#include <utils/Debug.h>

namespace android {
// ---------------------------------------------------------------------------

#define NUM_DISPLAY_MAX 4

struct display_cblk_t
{
    uint16_t    w;
    uint16_t    h;
    uint8_t     format;
    uint8_t     orientation;
    uint8_t     reserved[2];
    float       fps;
    float       density;
    float       xdpi;
    float       ydpi;
    uint32_t    pad[2];
};

struct surface_flinger_cblk_t   // 4KB max
{
    uint8_t         connected;
    uint8_t         reserved[3];
    uint32_t        pad[7];
    display_cblk_t  displays[NUM_DISPLAY_MAX];
};

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

COMPILE_TIME_ASSERT(sizeof(surface_flinger_cblk_t) <= 4096)

// ---------------------------------------------------------------------------
}; // namespace android

#endif /* ANDROID_SF_SHARED_BUFFER_STACK_H */
+10 −12
Original line number Original line Diff line number Diff line
@@ -14,7 +14,6 @@
 * limitations under the License.
 * limitations under the License.
 */
 */



#ifndef ANDROID_UI_DISPLAY_INFO_H
#ifndef ANDROID_UI_DISPLAY_INFO_H
#define ANDROID_UI_DISPLAY_INFO_H
#define ANDROID_UI_DISPLAY_INFO_H


@@ -28,13 +27,14 @@ namespace android {
struct DisplayInfo {
struct DisplayInfo {
    uint32_t w;
    uint32_t w;
    uint32_t h;
    uint32_t h;
    PixelFormatInfo     pixelFormatInfo;
    uint8_t             orientation;
    uint8_t             reserved[3];
    float               fps;
    float               density;
    float xdpi;
    float xdpi;
    float ydpi;
    float ydpi;
    float fps;
    float density;
    uint8_t orientation;
    uint8_t reserved[3];
    // TODO: this needs to go away (currently needed only by webkit)
    PixelFormatInfo pixelFormatInfo;
};
};


/* Display orientations as defined in Surface.java and ISurfaceComposer.h. */
/* Display orientations as defined in Surface.java and ISurfaceComposer.h. */
@@ -45,8 +45,6 @@ enum {
    DISPLAY_ORIENTATION_270 = 3
    DISPLAY_ORIENTATION_270 = 3
};
};



}; // namespace android
}; // namespace android


#endif // ANDROID_COMPOSER_DISPLAY_INFO_H
#endif // ANDROID_COMPOSER_DISPLAY_INFO_H
Loading