display: Do not control dpms in HAL 02/39002/1 accepted/tizen/common/20150507.110630 accepted/tizen/mobile/20150507.143531 accepted/tizen/tv/20150507.140652 accepted/tizen/wearable/20150507.141947 submit/tizen/20150507.094206
authorJiyoung Yun <jy910.yun@samsung.com>
Wed, 6 May 2015 12:36:49 +0000 (21:36 +0900)
committerJiyoung Yun <jy910.yun@samsung.com>
Wed, 6 May 2015 12:36:49 +0000 (21:36 +0900)
It will control by deviced.
Because it depends on display solution, not hardware.

Change-Id: I3041a0af3c1a8336b1c1d35b79367f8d16487dce
Signed-off-by: Jiyoung Yun <jy910.yun@samsung.com>
CMakeLists.txt
hw/display/CMakeLists.txt [moved from hw/display-x/CMakeLists.txt with 90% similarity]
hw/display/display.c [moved from hw/display-x/display.c with 70% similarity]
packaging/device-manager-plugin-exynos5433.spec

index b19441c..9175ff1 100644 (file)
@@ -3,7 +3,5 @@ PROJECT(device-manager-exynos5433 C)
 
 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
 
-IF(X11_SUPPORT)
-ADD_SUBDIRECTORY(hw/display-x)
-ENDIF(X11_SUPPORT)
+ADD_SUBDIRECTORY(hw/display)
 ADD_SUBDIRECTORY(hw/led)
similarity index 90%
rename from hw/display-x/CMakeLists.txt
rename to hw/display/CMakeLists.txt
index f1193e8..ebccfbe 100644 (file)
@@ -4,7 +4,7 @@ PROJECT(display C)
 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
 
 INCLUDE(FindPkgConfig)
-pkg_check_modules(display_pkgs REQUIRED hwcommon dlog x11 xext)
+pkg_check_modules(display_pkgs REQUIRED hwcommon dlog)
 
 FOREACH(flag ${display_pkgs_CFLAGS})
        SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
similarity index 70%
rename from hw/display-x/display.c
rename to hw/display/display.c
index f956d51..d5d0b84 100644 (file)
@@ -22,8 +22,6 @@
 #include <string.h>
 #include <errno.h>
 #include <linux/limits.h>
-#include <X11/Xlib.h>
-#include <X11/extensions/dpms.h>
 
 #include <hw/display.h>
 #include "../shared.h"
@@ -94,63 +92,6 @@ static int display_set_brightness(int brightness)
        return 0;
 }
 
-static int display_get_power_state(enum display_state *state)
-{
-       Display *dpy;
-       int dummy;
-       CARD16 dpms_state = DPMSModeOff;
-       BOOL onoff;
-
-       dpy = XOpenDisplay(NULL);
-       if (dpy == NULL) {
-               _E("fail to open display");
-               return -EPERM;
-       }
-
-       if (DPMSQueryExtension(dpy, &dummy, &dummy)) {
-               if (DPMSCapable(dpy)) {
-                       DPMSInfo(dpy, &dpms_state, &onoff);
-               }
-       }
-
-       XCloseDisplay(dpy);
-
-       if (state)
-               *state = dpms_state;
-
-       return 0;
-}
-
-static int display_set_power_state(enum display_state state)
-{
-       int type;
-       Display *dpy;
-
-       if (state == DISPLAY_ON)
-               type = DPMSModeOn;
-       else if (state == DISPLAY_STANDBY)
-               type = DPMSModeStandby;
-       else if (state == DISPLAY_SUSPEND)
-               type = DPMSModeSuspend;
-       else if (state == DISPLAY_OFF)
-               type = DPMSModeOff;
-       else
-               return -EINVAL;
-
-       dpy = XOpenDisplay(NULL);
-       if (dpy == NULL) {
-               _E("fail to open display");
-               return -EPERM;
-       }
-
-       DPMSEnable(dpy);
-       DPMSForceLevel(dpy, type);
-
-       XCloseDisplay(dpy);
-
-       return 0;
-}
-
 static int display_open(struct hw_info *info,
                const char *id, struct hw_common **common)
 {
@@ -166,8 +107,6 @@ static int display_open(struct hw_info *info,
        display_dev->common.info = info;
        display_dev->get_brightness = display_get_brightness;
        display_dev->set_brightness = display_set_brightness;
-       display_dev->get_state = display_get_power_state;
-       display_dev->set_state = display_set_power_state;
 
        *common = (struct hw_common *)display_dev;
        return 0;
index fa6939f..97ff9b0 100644 (file)
@@ -1,5 +1,3 @@
-%bcond_with x
-
 Name:       device-manager-plugin-exynos5433
 Summary:    Device manager plugin exynos5433
 Version:    0.0.1
@@ -13,10 +11,6 @@ Requires(postun): /sbin/ldconfig
 BuildRequires:  cmake
 BuildRequires:  pkgconfig(dlog)
 BuildRequires:  pkgconfig(hwcommon)
-%if %{with x}
-BuildRequires:  pkgconfig(x11)
-BuildRequires:  pkgconfig(xext)
-%endif
 
 %description
 Device manager plugin exynos 5433
@@ -27,13 +21,7 @@ Device manager plugin exynos 5433
 cp %{SOURCE1} .
 
 %build
-%if %{with x}
-%define X11_SUPPORT ON
-%else
-%define X11_SUPPORT OFF
-%endif
-
-%cmake . -DX11_SUPPORT:BOOL=%{X11_SUPPORT}
+%cmake .
 
 make %{?jobs:-j%jobs}