Skip to content

Commit

Permalink
Merge tag 'LA.UM.9.12.r1-11000-SMxx50.0' of https://source.codeaurora…
Browse files Browse the repository at this point in the history
….org/quic/la/platform/hardware/qcom/display into rippa-8250

"LA.UM.9.12.r1-11000-SMxx50.0"
  • Loading branch information
markakash committed Apr 12, 2021
2 parents 0cb23d3 + 17bdd36 commit 959e731
Show file tree
Hide file tree
Showing 10 changed files with 93 additions and 13 deletions.
6 changes: 4 additions & 2 deletions composer/display_null.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
* Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
Expand Down Expand Up @@ -118,7 +118,9 @@ DisplayError DisplayNull::Prepare(LayerStack *layer_stack) {
}

for (auto layer : layer_stack->layers) {
layer->composition = kCompositionGPU;
if (layer->composition != kCompositionGPUTarget) {
layer->composition = kCompositionGPU;
}
}
return kErrorNone;
}
Expand Down
12 changes: 7 additions & 5 deletions composer/display_null.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
* Copyright (c) 2017-2019, 2021, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
Expand Down Expand Up @@ -123,6 +123,12 @@ class DisplayNull : public DisplayInterface {
MAKE_NO_OP(SetDisplayElapseTime(uint64_t))
MAKE_NO_OP(ClearLUTs())

void SetActive(bool active) { active_ = active; }
bool IsActive() { return active_; }

private:
bool active_ = false;

protected:
DisplayConfigVariableInfo default_variable_config_ = {};
DisplayConfigFixedInfo default_fixed_config_ = {};
Expand Down Expand Up @@ -150,11 +156,7 @@ class DisplayNullExternal : public DisplayNull {
virtual DisplayError GetFrameBufferConfig(DisplayConfigVariableInfo *variable_info);
virtual DisplayError GetDisplayIdentificationData(uint8_t *out_port, uint32_t *out_data_size,
uint8_t *out_data);
void SetActive(bool active) { active_ = active; }
bool IsActive() { return active_; }

private:
bool active_ = false;
DisplayState state_ = kStateOff;
DisplayConfigVariableInfo fb_config_ = {};
};
Expand Down
5 changes: 4 additions & 1 deletion composer/hwc_display.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014-2020, The Linux Foundation. All rights reserved.
* Copyright (c) 2014-2021, The Linux Foundation. All rights reserved.
* Not a Contribution.
*
* Copyright 2015 The Android Open Source Project
Expand Down Expand Up @@ -248,6 +248,9 @@ class HWCDisplay : public DisplayEventHandler {
virtual int SetState(bool connected) {
return kErrorNotSupported;
}
virtual DisplayError SetStandByMode(bool enable) {
return kErrorNotSupported;
}
virtual DisplayError Flush() {
return kErrorNotSupported;
}
Expand Down
23 changes: 23 additions & 0 deletions composer/hwc_display_builtin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1239,6 +1239,29 @@ DisplayError HWCDisplayBuiltIn::GetSupportedDSIClock(std::vector<uint64_t> *bitc
return kErrorNotSupported;
}

DisplayError HWCDisplayBuiltIn::SetStandByMode(bool enable) {
if (enable) {
if (!display_null_.IsActive()) {
stored_display_intf_ = display_intf_;
display_intf_ = &display_null_;
display_null_.SetActive(true);
DLOGD("Null display is connected successfully");
} else {
DLOGD("Null display is already connected.");
}
} else {
if (display_null_.IsActive()) {
display_intf_ = stored_display_intf_;
validated_ = false;
display_null_.SetActive(false);
DLOGD("Display is connected successfully");
} else {
DLOGD("Display is already connected.");
}
}
return kErrorNone;
}

HWC2::Error HWCDisplayBuiltIn::UpdateDisplayId(hwc2_display_t id) {
id_ = id;
return HWC2::Error::None;
Expand Down
6 changes: 6 additions & 0 deletions composer/hwc_display_builtin.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#include "cpuhint.h"
#include "hwc_display.h"
#include "hwc_layers.h"
#include "display_null.h"

#include "gl_layer_stitch.h"

Expand Down Expand Up @@ -112,6 +113,7 @@ class HWCDisplayBuiltIn : public HWCDisplay, public SyncTask<LayerStitchTaskCode
virtual DisplayError SetDynamicDSIClock(uint64_t bitclk);
virtual DisplayError GetDynamicDSIClock(uint64_t *bitclk);
virtual DisplayError GetSupportedDSIClock(std::vector<uint64_t> *bitclk_rates);
virtual DisplayError SetStandByMode(bool enable);
virtual HWC2::Error UpdateDisplayId(hwc2_display_t id);
virtual HWC2::Error SetPendingRefresh();
virtual HWC2::Error SetPanelBrightness(float brightness);
Expand Down Expand Up @@ -233,6 +235,10 @@ class HWCDisplayBuiltIn : public HWCDisplay, public SyncTask<LayerStitchTaskCode
bool disable_dyn_fps_ = false;
bool enhance_idle_time_ = false;
bool force_reset_validate_ = false;

// NULL display
DisplayNull display_null_;
DisplayInterface *stored_display_intf_ = NULL;
};

} // namespace sdm
Expand Down
25 changes: 24 additions & 1 deletion composer/hwc_session.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014-2020, The Linux Foundation. All rights reserved.
* Copyright (c) 2014-2021, The Linux Foundation. All rights reserved.
* Not a Contribution.
*
* Copyright 2015 The Android Open Source Project
Expand Down Expand Up @@ -1697,6 +1697,14 @@ android::status_t HWCSession::notifyCallback(uint32_t command, const android::Pa
status = SetDisplayBrightnessScale(input_parcel);
break;

case qService::IQService::SET_STAND_BY_MODE:
if (!input_parcel) {
DLOGE("QService command = %d: input_parcel needed.", command);
break;
}
status = SetStandByMode(input_parcel);
break;

default:
DLOGW("QService command = %d is not supported.", command);
break;
Expand Down Expand Up @@ -2501,6 +2509,21 @@ android::status_t HWCSession::GetVisibleDisplayRect(const android::Parcel *input
return android::NO_ERROR;
}

android::status_t HWCSession::SetStandByMode(const android::Parcel *input_parcel) {
SCOPE_LOCK(locker_[HWC_DISPLAY_PRIMARY]);

bool enable = (input_parcel->readInt32() > 0);

if (!hwc_display_[HWC_DISPLAY_PRIMARY]) {
DLOGI("Primary display is not initialized");
return -EINVAL;
}

hwc_display_[HWC_DISPLAY_PRIMARY]->SetStandByMode(enable);

return android::NO_ERROR;
}

int HWCSession::CreatePrimaryDisplay() {
int status = -EINVAL;
HWDisplaysInfo hw_displays_info = {};
Expand Down
3 changes: 2 additions & 1 deletion composer/hwc_session.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014-2020, The Linux Foundation. All rights reserved.
* Copyright (c) 2014-2021, The Linux Foundation. All rights reserved.
* Not a Contribution.
*
* Copyright 2015 The Android Open Source Project
Expand Down Expand Up @@ -478,6 +478,7 @@ class HWCSession : hwc2_device_t, HWCUEventListener, public qClient::BnQClient,
android::status_t SetColorModeById(const android::Parcel *input_parcel);
android::status_t SetColorModeFromClient(const android::Parcel *input_parcel);
android::status_t getComposerStatus();
android::status_t SetStandByMode(const android::Parcel *input_parcel);
android::status_t SetQSyncMode(const android::Parcel *input_parcel);
android::status_t SetIdlePC(const android::Parcel *input_parcel);
android::status_t RefreshScreen(const android::Parcel *input_parcel);
Expand Down
18 changes: 17 additions & 1 deletion libqdutils/display_config.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013-2014, 2016, 2018-2020, The Linux Foundation. All rights reserved.
* Copyright (c) 2013-2014, 2016, 2018-2021, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
Expand Down Expand Up @@ -393,3 +393,19 @@ extern "C" int waitForComposerInit() {

return !status;
}

extern "C" int setStandByMode(int mode) {
status_t err = (status_t) FAILED_TRANSACTION;
sp<IQService> binder = getBinder();
Parcel inParcel, outParcel;

if(binder != NULL) {
inParcel.writeInt32(mode);
err = binder->dispatch(IQService::SET_STAND_BY_MODE,
&inParcel, &outParcel);
if(err) {
ALOGE("%s() failed with err %d", __FUNCTION__, err);
}
}
return err;
}
5 changes: 4 additions & 1 deletion libqdutils/display_config.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013 - 2016, 2018 - 2020, The Linux Foundation. All rights reserved.
* Copyright (c) 2013 - 2016, 2018 - 2021, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
Expand Down Expand Up @@ -170,6 +170,9 @@ int getSupportedBitClk(int dpy, std::vector<uint64_t>& bit_rates);
// Sets the specified min and max luminance values.
int setPanelLuminanceAttributes(int dpy, float min_lum, float max_lum);

// Sets display standy mode
extern "C" int setStandByMode(int mode);

}; //namespace


Expand Down
3 changes: 2 additions & 1 deletion libqservice/IQService.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2010 The Android Open Source Project
* Copyright (C) 2012-2014, 2016-2019 The Linux Foundation. All rights reserved.
* Copyright (C) 2012-2014, 2016-2019, 2021, The Linux Foundation. All rights reserved.
*
* Not a Contribution, Apache license notifications and license are
* retained for attribution purposes only.
Expand Down Expand Up @@ -79,6 +79,7 @@ class IQService : public android::IInterface
SET_PANEL_LUMINANCE = 47, // Set Panel Luminance attributes.
SET_BRIGHTNESS_SCALE = 48, // Set brightness scale ratio
SET_COLOR_SAMPLING_ENABLED = 49, // Toggle the collection of display color stats
SET_STAND_BY_MODE = 50, // Set stand by mode for MDP hardware
COMMAND_LIST_END = 400,
};

Expand Down

0 comments on commit 959e731

Please sign in to comment.