Skip to content

Commit

Permalink
Merge fdfb51f on remote branch
Browse files Browse the repository at this point in the history
Change-Id: Ic995b423d77aadb053c5a4883d79b3a43d5c2195
  • Loading branch information
Linux Build Service Account committed Nov 16, 2019
2 parents 2a846d8 + fdfb51f commit 2d4a71a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
19 changes: 16 additions & 3 deletions include/smomo_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,15 @@

namespace smomo {

#define SMOMO_LIBRARY_NAME "libsmomo.qti.so"
#define CREATE_SMOMO_INTERFACE_NAME "CreateSmomoInterface"
#define DESTROY_SMOMO_INTERFACE_NAME "DestroySmomoInterface"

#define SMOMO_REVISION_MAJOR (1)
#define SMOMO_REVISION_MINOR (0)
#define SMOMO_VERSION_TAG ((uint16_t) ((SMOMO_REVISION_MAJOR << 8) \
| SMOMO_REVISION_MINOR))

typedef int64_t nsecs_t;

/*! @brief This structure defines the layer stats required by SmoMo.
Expand All @@ -47,7 +56,7 @@ typedef int64_t nsecs_t;
*/
struct SmomoLayerStats {
std::string name; // layer full name
int32_t id; // layer ID
int32_t id; // layer ID
};

/*! @brief This structure defines the buffer stats required by SmoMo.
Expand All @@ -56,10 +65,11 @@ struct SmomoLayerStats {
@sa SmomoIntf::ShouldPresentNow
*/
struct SmomoBufferStats {
int32_t id; // layer ID
int32_t id; // layer ID
int32_t queued_frames; // queued frame count of this layer
bool auto_timestamp; // whether timestamp was generated automatically
nsecs_t timestamp; // layer buffer's timestamp
nsecs_t dequeue_latency; // last dequeue duration
};

/*! @brief SmoMo interface implemented by SmoMo library.
Expand Down Expand Up @@ -128,13 +138,16 @@ class SmomoIntf {
@details This function is called to tell SmoMo what refresh rates this display can suport.
@param[in] refresh_rates The refresh rates list supported by the display
@param[in] refresh_rates The refresh rates supported by the display
@return \link void \endlink
*/
virtual void SetDisplayRefreshRates(const std::vector<float> &refresh_rates) = 0;
};

typedef bool (*CreateSmomoInterface)(uint16_t version, SmomoIntf **interface);
typedef void (*DestroySmomoInterface)(SmomoIntf *interface);

} // namespace smomo

#endif // __SMOMO_INTERFACE_H__
6 changes: 3 additions & 3 deletions sdm/libs/hwc/hwc_session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -910,7 +910,7 @@ android::status_t HWCSession::HandleSetActiveDisplayConfig(const android::Parcel
int dpy = input_parcel->readInt32();
int error = android::BAD_VALUE;

if (dpy > HWC_DISPLAY_VIRTUAL) {
if (dpy < HWC_DISPLAY_PRIMARY || dpy > HWC_DISPLAY_VIRTUAL) {
return android::BAD_VALUE;
}

Expand All @@ -929,7 +929,7 @@ android::status_t HWCSession::HandleGetActiveDisplayConfig(const android::Parcel
int dpy = input_parcel->readInt32();
int error = android::BAD_VALUE;

if (dpy > HWC_DISPLAY_VIRTUAL) {
if (dpy < HWC_DISPLAY_PRIMARY || dpy > HWC_DISPLAY_VIRTUAL) {
return android::BAD_VALUE;
}

Expand All @@ -949,7 +949,7 @@ android::status_t HWCSession::HandleGetDisplayConfigCount(const android::Parcel
int dpy = input_parcel->readInt32();
int error = android::BAD_VALUE;

if (dpy > HWC_DISPLAY_VIRTUAL) {
if (dpy < HWC_DISPLAY_PRIMARY || dpy > HWC_DISPLAY_VIRTUAL) {
return android::BAD_VALUE;
}

Expand Down

0 comments on commit 2d4a71a

Please sign in to comment.