hwc2: Add support to read panel information from SKG HAL
- Implement GET_PANEL_RESOLUTION binder support. SKG HAL will use this api to read the panel width and height during boot time CRs-Fixed: 2338141 Change-Id: I18e1c84f8c535cccefc8800d94971e6f535b2532
This commit is contained in:
parent
c335833c9b
commit
50daadd4f4
|
@ -441,3 +441,22 @@ extern "C" int setStandByMode(int mode) {
|
|||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
extern "C" int getPanelResolution(int *width, int *height) {
|
||||
status_t err = (status_t) FAILED_TRANSACTION;
|
||||
sp<IQService> binder = getBinder();
|
||||
Parcel inParcel, outParcel;
|
||||
|
||||
if(binder != NULL) {
|
||||
err = binder->dispatch(IQService::GET_PANEL_RESOLUTION,
|
||||
&inParcel, &outParcel);
|
||||
if(err != 0) {
|
||||
ALOGE_IF(getBinder(), "%s() failed with err %d", __FUNCTION__, err);
|
||||
} else {
|
||||
*width = outParcel.readInt32();
|
||||
*height = outParcel.readInt32();
|
||||
}
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
|
|
|
@ -80,6 +80,7 @@ public:
|
|||
GET_SUPPORTED_DSI_CLK = 38, // Get supported DSI Clk.
|
||||
GET_COMPOSER_STATUS = 39, // Get composer init status-true if primary display init is done
|
||||
SET_STAND_BY_MODE = 40, //Set stand by mode for MDP hardware.
|
||||
GET_PANEL_RESOLUTION = 41, // Get Panel Resolution
|
||||
COMMAND_LIST_END = 400,
|
||||
};
|
||||
|
||||
|
|
|
@ -1113,6 +1113,10 @@ android::status_t HWCSession::notifyCallback(uint32_t command, const android::Pa
|
|||
status = SetStandByMode(input_parcel);
|
||||
break;
|
||||
|
||||
case qService::IQService::GET_PANEL_RESOLUTION:
|
||||
status = GetPanelResolution(input_parcel, output_parcel);
|
||||
break;
|
||||
|
||||
default:
|
||||
DLOGW("QService command = %d is not supported", command);
|
||||
return -EINVAL;
|
||||
|
@ -1716,6 +1720,24 @@ android::status_t HWCSession::SetStandByMode(const android::Parcel *input_parcel
|
|||
return android::NO_ERROR;
|
||||
}
|
||||
|
||||
android::status_t HWCSession::GetPanelResolution(const android::Parcel *input_parcel,
|
||||
android::Parcel *output_parcel) {
|
||||
SCOPE_LOCK(locker_[HWC_DISPLAY_PRIMARY]);
|
||||
|
||||
if (!hwc_display_[HWC_DISPLAY_PRIMARY]) {
|
||||
DLOGI("Primary display is not initialized");
|
||||
return -EINVAL;
|
||||
}
|
||||
auto panel_width = 0u;
|
||||
auto panel_height = 0u;
|
||||
|
||||
hwc_display_[HWC_DISPLAY_PRIMARY]->GetPanelResolution(&panel_width, &panel_height);
|
||||
output_parcel->writeInt32(INT32(panel_width));
|
||||
output_parcel->writeInt32(INT32(panel_height));
|
||||
|
||||
return android::NO_ERROR;
|
||||
}
|
||||
|
||||
void HWCSession::Refresh(hwc2_display_t display) {
|
||||
SCOPE_LOCK(callbacks_lock_);
|
||||
callbacks_.Refresh(display);
|
||||
|
|
|
@ -254,6 +254,8 @@ class HWCSession : hwc2_device_t, HWCUEventListener, public qClient::BnQClient,
|
|||
android::Parcel *output_parcel);
|
||||
android::status_t getComposerStatus();
|
||||
android::status_t SetStandByMode(const android::Parcel *input_parcel);
|
||||
android::status_t GetPanelResolution(const android::Parcel *input_parcel,
|
||||
android::Parcel *output_parcel);
|
||||
|
||||
|
||||
void Refresh(hwc2_display_t display);
|
||||
|
|
Loading…
Reference in New Issue