display: Add hook for triggering screen update

DSI command mode panels do not need to be refreshed on each
vsync. Due to one frame latency in CABL LUT calculation, when CABL is
enabled for DSI command mode panels, the LUT doesnt get updated for last
frame. Triggering an extra update for DSI command mode panels fixes it.

Change-Id: I7a22e338609430746dda4d3081ff199109a95035
This commit is contained in:
Jeykumar Sankaran
2013-02-28 10:45:56 -08:00
committed by Gerrit - the friendly Code Review server
parent db770e203f
commit 9f59a7685d
8 changed files with 57 additions and 8 deletions

View File

@@ -54,7 +54,7 @@ QClient::~QClient()
ALOGD_IF(QCLIENT_DEBUG,"QClient Destructor invoked");
}
void QClient::notifyCallback(uint32_t msg, uint32_t value) {
status_t QClient::notifyCallback(uint32_t msg, uint32_t value) {
switch(msg) {
case IQService::SECURING:
securing(value);
@@ -62,9 +62,13 @@ void QClient::notifyCallback(uint32_t msg, uint32_t value) {
case IQService::UNSECURING:
unsecuring(value);
break;
case IQService::SCREEN_REFRESH:
return screenRefresh();
break;
default:
return;
return NO_ERROR;
}
return NO_ERROR;
}
void QClient::securing(uint32_t startEnd) {
@@ -93,4 +97,14 @@ void QClient::MPDeathNotifier::died() {
mHwcContext->proc->invalidate(mHwcContext->proc);
}
android::status_t QClient::screenRefresh() {
status_t result = NO_INIT;
#ifdef QCOM_BSP
if(mHwcContext->proc) {
mHwcContext->proc->invalidate(mHwcContext->proc);
result = NO_ERROR;
}
#endif
return result;
}
}

View File

@@ -46,7 +46,7 @@ class QClient : public BnQClient {
public:
QClient(hwc_context_t *ctx);
virtual ~QClient();
virtual void notifyCallback(uint32_t msg, uint32_t value);
virtual android::status_t notifyCallback(uint32_t msg, uint32_t value);
private:
//Notifies of Media Player death
@@ -59,6 +59,7 @@ private:
void securing(uint32_t startEnd);
void unsecuring(uint32_t startEnd);
android::status_t screenRefresh();
hwc_context_t *mHwcContext;
const android::sp<android::IMediaDeathNotifier> mMPDeathNotifier;

View File

@@ -41,12 +41,14 @@ public:
BpQClient(const sp<IBinder>& impl)
: BpInterface<IQClient>(impl) {}
virtual void notifyCallback(uint32_t msg, uint32_t value) {
virtual status_t notifyCallback(uint32_t msg, uint32_t value) {
Parcel data, reply;
data.writeInterfaceToken(IQClient::getInterfaceDescriptor());
data.writeInt32(msg);
data.writeInt32(value);
remote()->transact(NOTIFY_CALLBACK, data, &reply);
status_t result = reply.readInt32();
return result;
}
};

View File

@@ -33,7 +33,7 @@ class IQClient : public android::IInterface
{
public:
DECLARE_META_INTERFACE(QClient);
virtual void notifyCallback(uint32_t msg, uint32_t value) = 0;
virtual android::status_t notifyCallback(uint32_t msg, uint32_t value) = 0;
};
// ----------------------------------------------------------------------------

View File

@@ -63,6 +63,14 @@ public:
data.writeStrongBinder(client->asBinder());
remote()->transact(CONNECT, data, &reply);
}
virtual status_t screenRefresh() {
Parcel data, reply;
data.writeInterfaceToken(IQService::getInterfaceDescriptor());
remote()->transact(SCREEN_REFRESH, data, &reply);
status_t result = reply.readInt32();
return result;
}
};
IMPLEMENT_META_INTERFACE(QService, "android.display.IQService");
@@ -88,7 +96,8 @@ status_t BnQService::onTransact(
switch(code) {
case SECURING: {
if(!permission) {
ALOGE("display.qservice SECURING access denied: pid=%d uid=%d process=%s",
ALOGE("display.qservice SECURING access denied: \
pid=%d uid=%d process=%s",
callerPid, callerUid, callingProcName);
return PERMISSION_DENIED;
}
@@ -99,7 +108,8 @@ status_t BnQService::onTransact(
} break;
case UNSECURING: {
if(!permission) {
ALOGE("display.qservice UNSECURING access denied: pid=%d uid=%d process=%s",
ALOGE("display.qservice UNSECURING access denied: \
pid=%d uid=%d process=%s",
callerPid, callerUid, callingProcName);
return PERMISSION_DENIED;
}
@@ -111,7 +121,8 @@ status_t BnQService::onTransact(
case CONNECT: {
CHECK_INTERFACE(IQService, data, reply);
if(callerUid != AID_GRAPHICS) {
ALOGE("display.qservice CONNECT access denied: pid=%d uid=%d process=%s",
ALOGE("display.qservice CONNECT access denied: \
pid=%d uid=%d process=%s",
callerPid, callerUid, callingProcName);
return PERMISSION_DENIED;
}
@@ -120,6 +131,16 @@ status_t BnQService::onTransact(
connect(client);
return NO_ERROR;
} break;
case SCREEN_REFRESH: {
CHECK_INTERFACE(IQService, data, reply);
if(callerUid != AID_GRAPHICS) {
ALOGE("display.qservice SCREEN_REFRESH access denied: \
pid=%d uid=%d process=%s",callerPid,
callerUid, callingProcName);
return PERMISSION_DENIED;
}
return screenRefresh();
} break;
default:
return BBinder::onTransact(code, data, reply, flags);
}

View File

@@ -40,6 +40,7 @@ public:
SECURING = android::IBinder::FIRST_CALL_TRANSACTION,
UNSECURING, // Hardware unsecuring start/end notification
CONNECT,
SCREEN_REFRESH,
};
enum {
END = 0,
@@ -48,6 +49,7 @@ public:
virtual void securing(uint32_t startEnd) = 0;
virtual void unsecuring(uint32_t startEnd) = 0;
virtual void connect(const android::sp<qClient::IQClient>& client) = 0;
virtual android::status_t screenRefresh() = 0;
};
// ----------------------------------------------------------------------------

View File

@@ -63,6 +63,14 @@ void QService::connect(const sp<qClient::IQClient>& client) {
mClient = client;
}
android::status_t QService::screenRefresh() {
status_t result = NO_ERROR;
if(mClient.get()) {
result = mClient->notifyCallback(SCREEN_REFRESH, 0);
}
return result;
}
void QService::init()
{
if(!sQService) {

View File

@@ -48,6 +48,7 @@ public:
virtual void securing(uint32_t startEnd);
virtual void unsecuring(uint32_t startEnd);
virtual void connect(const android::sp<qClient::IQClient>& client);
virtual android::status_t screenRefresh();
static void init();
private:
QService();