summaryrefslogtreecommitdiff
path: root/msm8909/libqdutils/display_config.h
diff options
context:
space:
mode:
Diffstat (limited to 'msm8909/libqdutils/display_config.h')
-rw-r--r--msm8909/libqdutils/display_config.h94
1 files changed, 78 insertions, 16 deletions
diff --git a/msm8909/libqdutils/display_config.h b/msm8909/libqdutils/display_config.h
index e9b2fc3c..6512bf53 100644
--- a/msm8909/libqdutils/display_config.h
+++ b/msm8909/libqdutils/display_config.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2013 - 2016 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
@@ -26,24 +26,33 @@
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+
+#ifndef _DISPLAY_CONFIG_H
+#define _DISPLAY_CONFIG_H
+
#include <gralloc_priv.h>
#include <qdMetaData.h>
-#include <mdp_version.h>
#include <hardware/hwcomposer.h>
-// This header is for clients to use to set/get global display configuration
-// The functions in this header run in the client process and wherever necessary
-// do a binder call to HWC to get/set data.
+// This header is for clients to use to set/get global display configuration.
// Only primary and external displays are supported here.
-// WiFi/virtual displays are not supported.
namespace qdutils {
+
+/* TODO: Have all the common enums that need be exposed to clients and which
+ * are also needed in hwc defined here. Remove such definitions we have in
+ * hwc_utils.h
+ */
+
// Use this enum to specify the dpy parameters where needed
enum {
- DISPLAY_PRIMARY = HWC_DISPLAY_PRIMARY,
+ DISPLAY_PRIMARY = HWC_DISPLAY_PRIMARY,
DISPLAY_EXTERNAL = HWC_DISPLAY_EXTERNAL,
- DISPLAY_VIRTUAL = HWC_DISPLAY_VIRTUAL,
+#ifdef QTI_BSP
+ DISPLAY_TERTIARY = HWC_DISPLAY_TERTIARY,
+#endif
+ DISPLAY_VIRTUAL = HWC_DISPLAY_VIRTUAL,
};
// External Display states - used in setSecondaryDisplayStatus()
@@ -61,16 +70,37 @@ enum {
SET_BINDER_DYN_REFRESH_RATE,
};
+enum {
+ DEFAULT_MODE = 0,
+ VIDEO_MODE,
+ COMMAND_MODE,
+};
+
+enum {
+ DISPLAY_PORT_DEFAULT = 0,
+ DISPLAY_PORT_DSI,
+ DISPLAY_PORT_DTV,
+ DISPLAY_PORT_WRITEBACK,
+ DISPLAY_PORT_LVDS,
+ DISPLAY_PORT_EDP,
+ DISPLAY_PORT_DP,
+};
+
// Display Attributes that are available to clients of this library
// Not to be confused with a similar struct in hwc_utils (in the hwc namespace)
-struct DisplayAttributes_t {
- uint32_t vsync_period; //nanoseconds
- uint32_t xres;
- uint32_t yres;
- float xdpi;
- float ydpi;
- char panel_type;
-};
+typedef struct DisplayAttributes {
+ uint32_t vsync_period = 0; //nanoseconds
+ uint32_t xres = 0;
+ uint32_t yres = 0;
+ float xdpi = 0.0f;
+ float ydpi = 0.0f;
+ int panel_type = DISPLAY_PORT_DEFAULT;
+ bool is_yuv = false;
+} DisplayAttributes_t;
+
+//=============================================================================
+// The functions below run in the client process and wherever necessary
+// do a binder call to HWC to get/set data.
// Check if external display is connected. Useful to check before making
// calls for external displays
@@ -98,4 +128,36 @@ int setSecondaryDisplayStatus(int dpy, uint32_t status);
// Enable/Disable/Set refresh rate dynamically
int configureDynRefreshRate(uint32_t op, uint32_t refreshRate);
+
+// Returns the number of configs supported for the display on success.
+// Returns -1 on error.
+// Only primary display supported for now, value of dpy ignored.
+int getConfigCount(int dpy);
+
+// Returns the index of config that is current set for the display on success.
+// Returns -1 on error.
+// Only primary display supported for now, value of dpy ignored.
+int getActiveConfig(int dpy);
+
+// Sets the config for the display on success and returns 0.
+// Returns -1 on error.
+// Only primary display supported for now, value of dpy ignored
+int setActiveConfig(int configIndex, int dpy);
+
+// Returns the attributes for the specified config for the display on success.
+// Returns xres and yres as 0 on error.
+// Only primary display supported for now, value of dpy ignored
+DisplayAttributes getDisplayAttributes(int configIndex, int dpy);
+
+// Set the primary display mode to command or video mode
+int setDisplayMode(int mode);
+
+// Sets the panel brightness of the primary display
+int setPanelBrightness(int level);
+
+// Retrieves the current panel brightness value
+int getPanelBrightness();
+
}; //namespace
+
+#endif