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

Commit 8219e912 authored by Mathias Agopian's avatar Mathias Agopian Committed by Android (Google) Code Review
Browse files

Merge changes If4126023,Iacda2386,I1eb691f7,Ib56139f8

* changes:
  Add support for sending VSYNC events to the framework
  BitTube::read now handles EAGAIN
  split ComposerService out of SurfaceComposerClient.h
  rewrite SF's message loop on top of Looper
parents 4c810740 461afeb9
Loading
Loading
Loading
Loading
+53 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2011 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_PRIVATE_GUI_COMPOSER_SERVICE_H
#define ANDROID_PRIVATE_GUI_COMPOSER_SERVICE_H

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

#include <utils/Singleton.h>
#include <utils/StrongPointer.h>


namespace android {

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

class IMemoryHeap;
class ISurfaceComposer;
class surface_flinger_cblk_t;

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

class ComposerService : public Singleton<ComposerService>
{
    // these are constants
    sp<ISurfaceComposer> mComposerService;
    sp<IMemoryHeap> mServerCblkMemory;
    surface_flinger_cblk_t volatile* mServerCblk;
    ComposerService();
    friend class Singleton<ComposerService>;
public:
    static sp<ISurfaceComposer> getComposerService();
    static surface_flinger_cblk_t const volatile * getControlBlock();
};

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

#endif // ANDROID_PRIVATE_GUI_COMPOSER_SERVICE_H
+9 −1
Original line number Diff line number Diff line
@@ -33,8 +33,9 @@
namespace android {
// ----------------------------------------------------------------------------

class IMemoryHeap;
class ComposerState;
class IDisplayEventConnection;
class IMemoryHeap;

class ISurfaceComposer : public IInterface
{
@@ -124,13 +125,19 @@ public:
            uint32_t reqWidth, uint32_t reqHeight,
            uint32_t minLayerZ, uint32_t maxLayerZ) = 0;

    /* triggers screen off animation */
    virtual status_t turnElectronBeamOff(int32_t mode) = 0;

    /* triggers screen on animation */
    virtual status_t turnElectronBeamOn(int32_t mode) = 0;

    /* verify that an ISurfaceTexture was created by SurfaceFlinger.
     */
    virtual bool authenticateSurfaceTexture(
            const sp<ISurfaceTexture>& surface) const = 0;

    /* return an IDisplayEventConnection */
    virtual sp<IDisplayEventConnection> createDisplayEventConnection() = 0;
};

// ----------------------------------------------------------------------------
@@ -151,6 +158,7 @@ public:
        TURN_ELECTRON_BEAM_OFF,
        TURN_ELECTRON_BEAM_ON,
        AUTHENTICATE_SURFACE,
        CREATE_DISPLAY_EVENT_CONNECTION,
    };

    virtual status_t    onTransact( uint32_t code,
+1 −21
Original line number Diff line number Diff line
@@ -28,7 +28,6 @@
#include <utils/threads.h>

#include <ui/PixelFormat.h>
#include <ui/Region.h>

#include <surfaceflinger/Surface.h>

@@ -39,30 +38,11 @@ namespace android {
class DisplayInfo;
class Composer;
class IMemoryHeap;
class ISurfaceComposer;
class ISurfaceComposerClient;
class Region;
class surface_flinger_cblk_t;
struct layer_state_t;

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

class ComposerService : public Singleton<ComposerService>
{
    // these are constants
    sp<ISurfaceComposer> mComposerService;
    sp<IMemoryHeap> mServerCblkMemory;
    surface_flinger_cblk_t volatile* mServerCblk;
    ComposerService();
    friend class Singleton<ComposerService>;
public:
    static sp<ISurfaceComposer> getComposerService();
    static surface_flinger_cblk_t const volatile * getControlBlock();
};

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

class Composer;

class SurfaceComposerClient : public RefBase
{
    friend class Composer;
+2 −0
Original line number Diff line number Diff line
@@ -3,6 +3,8 @@ include $(CLEAR_VARS)

LOCAL_SRC_FILES:= \
	BitTube.cpp \
	DisplayEventReceiver.cpp \
	IDisplayEventConnection.cpp \
	ISensorEventConnection.cpp \
	ISensorServer.cpp \
	ISurfaceTexture.cpp \
+5 −0
Original line number Diff line number Diff line
@@ -97,6 +97,11 @@ ssize_t BitTube::read(void* vaddr, size_t size)
        len = ::read(mReceiveFd, vaddr, size);
        err = len < 0 ? errno : 0;
    } while (err == EINTR);
    if (err == EAGAIN || err == EWOULDBLOCK) {
        // EAGAIN means that we have non-blocking I/O but there was
        // no data to be read. Nothing the client should care about.
        return 0;
    }
    return err == 0 ? len : -err;
}

Loading