get rid of ro.sf.hwrotation, it's not used anymore

Change-Id: I2ee469ac89ecd65d7187be5cab08b5cc18f67cbe
This commit is contained in:
Mathias Agopian 2012-07-24 21:08:59 -07:00
parent 8785578391
commit 98a121aa91
3 changed files with 23 additions and 67 deletions

View File

@ -233,48 +233,19 @@ void DisplayHardware::init(EGLConfig config)
mHwc->setFrameBuffer(mDisplay, mSurface);
}
// initialize the display orientation transform.
// it's a constant that should come from the display driver.
int displayOrientation = ISurfaceComposer::eOrientationDefault;
char property[PROPERTY_VALUE_MAX];
if (property_get("ro.sf.hwrotation", property, NULL) > 0) {
//displayOrientation
switch (atoi(property)) {
case 90:
displayOrientation = ISurfaceComposer::eOrientation90;
break;
case 270:
displayOrientation = ISurfaceComposer::eOrientation270;
break;
}
}
w = mDisplayWidth;
h = mDisplayHeight;
DisplayHardware::orientationToTransfrom(displayOrientation, w, h,
&mDisplayTransform);
if (displayOrientation & ISurfaceComposer::eOrientationSwapMask) {
mLogicalDisplayWidth = h;
mLogicalDisplayHeight = w;
} else {
mLogicalDisplayWidth = w;
mLogicalDisplayHeight = h;
}
DisplayHardware::setOrientation(ISurfaceComposer::eOrientationDefault);
// initialize the shared control block
surface_flinger_cblk_t* const scblk = mFlinger->getControlBlock();
scblk->connected |= 1 << mDisplayId;
display_cblk_t* dcblk = &scblk->displays[mDisplayId];
memset(dcblk, 0, sizeof(display_cblk_t));
dcblk->w = w; // XXX: plane.getWidth();
dcblk->h = h; // XXX: plane.getHeight();
dcblk->format = format;
dcblk->orientation = ISurfaceComposer::eOrientationDefault;
dcblk->xdpi = mDpiX;
dcblk->ydpi = mDpiY;
dcblk->fps = mRefreshRate;
dcblk->density = mDensity;
// initialize the display orientation transform.
DisplayHardware::setOrientation(ISurfaceComposer::eOrientationDefault);
}
void DisplayHardware::setVSyncHandler(const sp<VSyncHandler>& handler) {
@ -438,25 +409,25 @@ status_t DisplayHardware::orientationToTransfrom(
return NO_ERROR;
}
status_t DisplayHardware::setOrientation(int orientation)
{
// If the rotation can be handled in hardware, this is where
// the magic should happen.
status_t DisplayHardware::setOrientation(int orientation) {
int w = mDisplayWidth;
int h = mDisplayHeight;
const int w = mLogicalDisplayWidth;
const int h = mLogicalDisplayHeight;
mUserDisplayWidth = w;
mUserDisplayHeight = h;
Transform orientationTransform;
DisplayHardware::orientationToTransfrom(orientation, w, h,
&orientationTransform);
DisplayHardware::orientationToTransfrom(
orientation, w, h, &mGlobalTransform);
if (orientation & ISurfaceComposer::eOrientationSwapMask) {
mUserDisplayWidth = h;
mUserDisplayHeight = w;
int tmp = w;
w = h;
h = tmp;
}
mOrientation = orientation;
mGlobalTransform = mDisplayTransform * orientationTransform;
// update the shared control block
surface_flinger_cblk_t* const scblk = mFlinger->getControlBlock();
volatile display_cblk_t* dcblk = &scblk->displays[mDisplayId];
dcblk->orientation = orientation;
dcblk->w = w;
dcblk->h = h;
return NO_ERROR;
}

View File

@ -91,8 +91,6 @@ public:
status_t setOrientation(int orientation);
int getOrientation() const { return mOrientation; }
const Transform& getTransform() const { return mGlobalTransform; }
int getUserWidth() const { return mUserDisplayWidth; }
int getUserHeight() const { return mUserDisplayHeight; }
void setVSyncHandler(const sp<VSyncHandler>& handler);
@ -166,19 +164,13 @@ private:
// this used to be in GraphicPlane
static status_t orientationToTransfrom(int orientation, int w, int h,
Transform* tr);
Transform mGlobalTransform;
Transform mDisplayTransform;
int mOrientation;
int mLogicalDisplayWidth;
int mLogicalDisplayHeight;
int mUserDisplayWidth;
int mUserDisplayHeight;
mutable Mutex mLock;
Transform mGlobalTransform;
int mOrientation;
/*
* protected by mLock
*/
mutable Mutex mLock;
wp<VSyncHandler> mVSyncHandler;
};

View File

@ -805,14 +805,7 @@ Region SurfaceFlinger::handleTransactionLocked(uint32_t transactionFlags)
const int dpy = 0; // TODO: should be a parameter
DisplayHardware& hw(const_cast<DisplayHardware&>(getDisplayHardware(dpy)));
const int orientation = mCurrentState.orientation;
hw.setOrientation(orientation);
// update the shared control block
volatile display_cblk_t* dcblk = mServerCblk->displays + dpy;
dcblk->orientation = orientation;
dcblk->w = hw.getUserWidth();
dcblk->h = hw.getUserHeight();
hw.setOrientation(mCurrentState.orientation);
// FIXME: mVisibleRegionsDirty & mDirtyRegion should this be per DisplayHardware?
mVisibleRegionsDirty = true;