From fe83d3dbfb2a5ed6bbd811635beaef9bd602e215 Mon Sep 17 00:00:00 2001 From: "jk7744.park" Date: Sat, 24 Oct 2015 17:20:17 +0900 Subject: [PATCH] tizen 2.4 release --- configure.ac | 4 ++-- include/X11/extensions/hwc.h | 5 +++-- packaging/libhwc.spec | 5 +++-- src/hwc.c | 32 +++++++++++++++++++++++++++++--- 4 files changed, 37 insertions(+), 9 deletions(-) diff --git a/configure.ac b/configure.ac index cbc2750..c932b78 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.61) -AC_INIT(libhwc, 0.1.0, [http://]) +AC_INIT(libhwc, 0.2.0, [http://]) AC_CONFIG_SRCDIR([src/hwc.c]) AC_CONFIG_HEADER([config.h]) @@ -16,7 +16,7 @@ PKG_CHECK_MODULES(XLIBS, x11 xext) AC_SUBST(XLIBS_CFLAGS) AC_SUBST(XLIBS_LIBS) -PKG_CHECK_MODULES(HWCPROTO, hwcproto) +PKG_CHECK_MODULES(HWCPROTO, hwcproto >= 0.2.0) AC_SUBST(HWCPROTO_CFLAGS) AC_SUBST(HWCPROTO_LIBS) diff --git a/include/X11/extensions/hwc.h b/include/X11/extensions/hwc.h index 890998c..ecb7c42 100755 --- a/include/X11/extensions/hwc.h +++ b/include/X11/extensions/hwc.h @@ -35,6 +35,7 @@ #define _HWC_H_ #include +#include #include #include @@ -45,10 +46,10 @@ extern Bool HWCQueryVersion(Display * display, int *major, int *minor); extern Bool -HWCOpen(Display * dpy, Window window, int *maxLayer); +HWCOpen(Display * dpy, RRCrtc crtc, int *maxLayer); extern void -HWCSetDrawables(Display * dpy, Window window, Drawable *drawables, XRectangle *srcRect, XRectangle *dstRect, int count); +HWCSetDrawables(Display * dpy, RRCrtc crtc, Window window, Drawable *drawables, XRectangle *srcRect, XRectangle *dstRect, HWCCompositeMethod *compMethods, int count); extern void HWCSelectInput(Display * dpy, Window window, int mask); diff --git a/packaging/libhwc.spec b/packaging/libhwc.spec index 88ad2eb..3c15195 100644 --- a/packaging/libhwc.spec +++ b/packaging/libhwc.spec @@ -1,13 +1,14 @@ Name: libhwc Summary: X.Org HWC Extension client library -Version: 0.1.1 -Release: 13 +Version: 0.2.0 +Release: 1 Group: System/Libraries License: MIT Source0: %{name}-%{version}.tar.gz BuildRequires: pkgconfig(hwcproto) BuildRequires: pkgconfig(x11) BuildRequires: pkgconfig(xext) +BuildRequires: pkgconfig(xrandr) %description diff --git a/src/hwc.c b/src/hwc.c index 8d15b05..9cfb96a 100755 --- a/src/hwc.c +++ b/src/hwc.c @@ -218,6 +218,12 @@ HWCQueryVersion(Display * dpy, int *major, int *minor) LockDisplay(dpy); GetReq(HWCQueryVersion, req); + if (!req) { + UnlockDisplay(dpy); + SyncHandle(); + return False; + } + req->reqType = info->codes->major_opcode; req->hwcReqType = X_HWCQueryVersion; req->majorVersion = HWC_MAJOR; @@ -236,7 +242,7 @@ HWCQueryVersion(Display * dpy, int *major, int *minor) } Bool -HWCOpen(Display * dpy, Window window, int *maxLayer) +HWCOpen(Display * dpy, RRCrtc crtc, int *maxLayer) { XExtDisplayInfo *info = HWCFindDisplay(dpy); xHWCOpenReply rep; @@ -246,9 +252,16 @@ HWCOpen(Display * dpy, Window window, int *maxLayer) LockDisplay(dpy); GetReq(HWCOpen, req); + if (!req) { + UnlockDisplay(dpy); + SyncHandle(); + return False; + } + req->reqType = info->codes->major_opcode; req->hwcReqType = X_HWCOpen; - req->window = window; + req->window = 0; + req->crtc = crtc; if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) { UnlockDisplay(dpy); @@ -265,7 +278,7 @@ HWCOpen(Display * dpy, Window window, int *maxLayer) } void -HWCSetDrawables(Display * dpy, Window window, Drawable *drawables, XRectangle *srcRect, XRectangle *dstRect, int count) +HWCSetDrawables(Display * dpy, RRCrtc crtc, Window window, Drawable *drawables, XRectangle *srcRect, XRectangle *dstRect, HWCCompositeMethod *compMethods, int count) { XExtDisplayInfo *info = HWCFindDisplay(dpy); xHWCSetDrawablesReq *req; @@ -276,11 +289,17 @@ HWCSetDrawables(Display * dpy, Window window, Drawable *drawables, XRectangle *s LockDisplay(dpy); GetReqExtra(HWCSetDrawables, count * SIZEOF(xHWCDrawInfo), req); + if (!req) { + UnlockDisplay(dpy); + SyncHandle(); + return; + } req->reqType = info->codes->major_opcode; req->hwcReqType = X_HWCSetDrawables; req->window = window; req->count = count; + req->crtc = crtc; p = (xHWCDrawInfo *) & req[1]; for (i = 0; i < count; i++) { @@ -293,6 +312,7 @@ HWCSetDrawables(Display * dpy, Window window, Drawable *drawables, XRectangle *s p[i].dstY = dstRect[i].y; p[i].dstWidth = dstRect[i].width; p[i].dstHeight = dstRect[i].height; + p[i].compMethod = compMethods[i]; } UnlockDisplay(dpy); @@ -309,6 +329,12 @@ HWCSelectInput(Display * dpy, Window window, int mask) LockDisplay(dpy); GetReq(HWCSelectInput, req); + if (!req) { + UnlockDisplay(dpy); + SyncHandle(); + return; + } + req->reqType = info->codes->major_opcode; req->hwcReqType = X_HWCSelectInput; req->window = window; -- 2.7.4