Skip to content

Commit

Permalink
sf: Set view frame of each display using binder
Browse files Browse the repository at this point in the history
Set the view frame of a display using binder when set projection
for that display changes

Change-Id: Ib85ce80e88b207a4cf2559b2cc0e74e60ab3d4d4
  • Loading branch information
Ramkumar Radhakrishnan authored and hyperb1iss committed Jul 14, 2014
1 parent bc9ad36 commit 04b8813
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
6 changes: 6 additions & 0 deletions services/surfaceflinger/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,15 @@ endif
ifeq ($(TARGET_USES_QCOM_BSP), true)
ifneq ($(TARGET_QCOM_DISPLAY_VARIANT),)
LOCAL_C_INCLUDES += hardware/qcom/display-$(TARGET_QCOM_DISPLAY_VARIANT)/libgralloc
LOCAL_C_INCLUDES += hardware/qcom/display-$(TARGET_QCOM_DISPLAY_VARIANT)/libqdutils
ifeq ($(TARGET_QCOM_DISPLAY_VARIANT),caf-new)
LOCAL_CFLAGS += -DQCOM_B_FAMILY
endif
else
LOCAL_C_INCLUDES += hardware/qcom/display/$(TARGET_BOARD_PLATFORM)/libgralloc
LOCAL_C_INCLUDES += hardware/qcom/display/$(TARGET_BOARD_PLATFORM)/libqdutils
endif
LOCAL_SHARED_LIBRARIES += libqdutils
LOCAL_CFLAGS += -DQCOM_BSP
endif

Expand Down
22 changes: 21 additions & 1 deletion services/surfaceflinger/SurfaceFlinger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@
#include "SecTVOutService.h"
#endif

#ifdef QCOM_BSP
#include <display_config.h>
#endif

#define DISPLAY_COUNT 1

/*
Expand Down Expand Up @@ -1503,12 +1507,15 @@ void SurfaceFlinger::handleTransactionLocked(uint32_t transactionFlags)
|| (state.viewport != draw[i].viewport)
|| (state.frame != draw[i].frame))
{
#ifdef QCOM_BSP
int orient = state.orientation;
// Honor the orientation change after boot
// animation completes and make sure boot
// animation is shown in panel orientation always.
if(mBootFinished){
disp->setProjection(state.orientation,
state.viewport, state.frame);
orient = state.orientation;
}
else{
char property[PROPERTY_VALUE_MAX];
Expand All @@ -1520,8 +1527,21 @@ void SurfaceFlinger::handleTransactionLocked(uint32_t transactionFlags)
}
disp->setProjection(panelOrientation,
state.viewport, state.frame);

orient = panelOrientation;
}
#endif
#ifdef QCOM_B_FAMILY
// Set the view frame of each display only of its
// default orientation.
if(orient == DisplayState::eOrientationDefault) {
qdutils::setViewFrame(disp->getHwcDisplayId(),
state.frame.left, state.frame.top,
state.frame.right, state.frame.bottom);
}
#else
disp->setProjection(state.orientation,
state.viewport, state.frame);
#endif
}
}
}
Expand Down

0 comments on commit 04b8813

Please sign in to comment.