Re: [PATCH util-modular 1/3] xorg.modules: Add libevdev requirement to synaptics

2015-03-16 Thread Peter Hutterer
On Mon, Mar 16, 2015 at 11:45:11AM -0400, Gaetan Nadon wrote:
 On 15-03-15 06:47 PM, Peter Hutterer wrote:
  Signed-off-by: Peter Hutterer peter.hutte...@who-t.net
  ---
   xorg.modules | 1 +
   1 file changed, 1 insertion(+)
 
  diff --git a/xorg.modules b/xorg.modules
  index 7216192..6d80c6b 100644
  --- a/xorg.modules
  +++ b/xorg.modules
  @@ -1974,6 +1974,7 @@
 dep package=libX11/
 dep package=libXi/
 dep package=xserver/
  +  dep package=libevdev/
   /dependencies
 /autotools
   
 
 Should we not preserve the comment as well? Unless of course it was
 wrong in the first place.
 This helps those customizing the list and saves them from debugging
 build problems on non Linux platforms.
 
 -  dep package=libevdev/   !-- Linux 
 Only --

Added the comment back in, thanks. It's still accurate, though FreeBSD now
has an evdev implementation (as of last GSoC), not 100% on it's state though

Cheers,
   Peter

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

[PATCH 2/2] modesetting: Include dix-config.h from dumb_bo.c

2015-03-16 Thread Michel Dänzer
From: Michel Dänzer michel.daen...@amd.com

Fixes mmap failures with 32-bit builds.

Signed-off-by: Michel Dänzer mic...@daenzer.net
---
 hw/xfree86/drivers/modesetting/dumb_bo.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/hw/xfree86/drivers/modesetting/dumb_bo.c 
b/hw/xfree86/drivers/modesetting/dumb_bo.c
index 58d420e..cf13f0a 100644
--- a/hw/xfree86/drivers/modesetting/dumb_bo.c
+++ b/hw/xfree86/drivers/modesetting/dumb_bo.c
@@ -25,6 +25,10 @@
  *
  */
 
+#ifdef HAVE_DIX_CONFIG_H
+#include dix-config.h
+#endif
+
 #include dumb_bo.h
 
 #include errno.h
-- 
2.1.4

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

[PATCH 07/14] DRI2: Use helper functions for DRM event queue management v3

2015-03-16 Thread Michel Dänzer
From: Michel Dänzer michel.daen...@amd.com

This is mostly in preparation for Present support, but it also simplifies
the DRI2 specific code a little.

v2: Fix up for struct radeon_drm_queue - radeon_drm_queue_entry.
v3: Removed excess 0s from conversion from microseconds to seconds,
thanks to Richard Wilbur richard.wil...@gmail.com for the catch!

Signed-off-by: Michel Dänzer michel.daen...@amd.com
---
 src/drmmode_display.c |  86 ++--
 src/drmmode_display.h |  12 ++-
 src/radeon_dri2.c | 267 +++---
 src/radeon_dri2.h |  37 ---
 4 files changed, 166 insertions(+), 236 deletions(-)

diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index cebd206..5ea2344 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -1799,45 +1799,52 @@ static const xf86CrtcConfigFuncsRec 
drmmode_xf86crtc_config_funcs = {
 };
 
 static void
-drmmode_vblank_handler(int fd, unsigned int frame, unsigned int tv_sec,
-   unsigned int tv_usec, void *event_data)
+drmmode_flip_free(drmmode_flipevtcarrier_ptr flipcarrier)
 {
-   radeon_dri2_frame_event_handler(frame, tv_sec, tv_usec, event_data);
+   drmmode_flipdata_ptr flipdata = flipcarrier-flipdata;
+
+   free(flipcarrier);
+
+   if (--flipdata-flip_count  0)
+   return;
+
+   /* Release framebuffer */
+   drmModeRmFB(flipdata-drmmode-fd, flipdata-old_fb_id);
+
+   free(flipdata);
 }
 
 static void
-drmmode_flip_handler(int fd, unsigned int frame, unsigned int tv_sec,
-unsigned int tv_usec, void *event_data)
+drmmode_flip_abort(ScrnInfoPtr scrn, void *event_data)
+{
+   drmmode_flipevtcarrier_ptr flipcarrier = event_data;
+   drmmode_flipdata_ptr flipdata = flipcarrier-flipdata;
+
+   if (flipdata-flip_count == 1)
+   flipcarrier-abort(scrn, flipdata-event_data);
+
+   drmmode_flip_free(flipcarrier);
+}
+
+static void
+drmmode_flip_handler(ScrnInfoPtr scrn, uint32_t frame, uint64_t usec, void 
*event_data)
 {
drmmode_flipevtcarrier_ptr flipcarrier = event_data;
drmmode_flipdata_ptr flipdata = flipcarrier-flipdata;
-   drmmode_ptr drmmode = flipdata-drmmode;
 
/* Is this the event whose info shall be delivered to higher level? */
if (flipcarrier-dispatch_me) {
/* Yes: Cache msc, ust for later delivery. */
flipdata-fe_frame = frame;
-   flipdata-fe_tv_sec = tv_sec;
-   flipdata-fe_tv_usec = tv_usec;
+   flipdata-fe_usec = usec;
}
-   free(flipcarrier);
-
-   /* Last crtc completed flip? */
-   flipdata-flip_count--;
-   if (flipdata-flip_count  0)
-   return;
-
-   /* Release framebuffer */
-   drmModeRmFB(drmmode-fd, flipdata-old_fb_id);
-
-   if (flipdata-event_data == NULL)
-   return;
 
/* Deliver cached msc, ust from reference crtc to flip event handler */
-   radeon_dri2_flip_event_handler(flipdata-fe_frame, flipdata-fe_tv_sec,
-  flipdata-fe_tv_usec, 
flipdata-event_data);
+   if (flipdata-event_data  flipdata-flip_count == 1)
+   flipcarrier-handler(scrn, flipdata-fe_frame, 
flipdata-fe_usec,
+flipdata-event_data);
 
-   free(flipdata);
+   drmmode_flip_free(flipcarrier);
 }
 
 
@@ -1884,8 +1891,8 @@ Bool drmmode_pre_init(ScrnInfoPtr pScrn, drmmode_ptr 
drmmode, int cpp)
xf86InitialConfiguration(pScrn, TRUE);
 
drmmode-event_context.version = DRM_EVENT_CONTEXT_VERSION;
-   drmmode-event_context.vblank_handler = drmmode_vblank_handler;
-   drmmode-event_context.page_flip_handler = drmmode_flip_handler;
+   drmmode-event_context.vblank_handler = radeon_drm_queue_handler;
+   drmmode-event_context.page_flip_handler = radeon_drm_queue_handler;
 
drmModeFreeResources(mode_res);
return TRUE;
@@ -2229,7 +2236,10 @@ void drmmode_uevent_fini(ScrnInfoPtr scrn, drmmode_ptr 
drmmode)
 #endif
 }
 
-Bool radeon_do_pageflip(ScrnInfoPtr scrn, struct radeon_bo *new_front, void 
*data, int ref_crtc_hw_id)
+Bool radeon_do_pageflip(ScrnInfoPtr scrn, ClientPtr client,
+   struct radeon_bo *new_front, uint64_t id, void *data,
+   int ref_crtc_hw_id, radeon_drm_handler_proc handler,
+   radeon_drm_abort_proc abort)
 {
RADEONInfoPtr info = RADEONPTR(scrn);
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
@@ -2240,7 +2250,8 @@ Bool radeon_do_pageflip(ScrnInfoPtr scrn, struct 
radeon_bo *new_front, void *dat
uint32_t tiling_flags = 0;
int height, emitted = 0;
drmmode_flipdata_ptr flipdata;
-   drmmode_flipevtcarrier_ptr flipcarrier;
+   drmmode_flipevtcarrier_ptr flipcarrier = NULL;
+   struct radeon_drm_queue_entry *drm_queue = 0;
 
if (info-allowColorTiling) {

Re: [PATCH 07/14] DRI2: Use helper functions for DRM event queue management

2015-03-16 Thread Michel Dänzer
On 17.03.2015 00:38, Richard Wilbur wrote:
 On Thu, Mar 12, 2015 at 12:10 AM, Michel Dänzer mic...@daenzer.net wrote:
 [...]
 diff --git a/src/radeon_dri2.c b/src/radeon_dri2.c
 index a3f0776..97164b6 100644
 --- a/src/radeon_dri2.c
 +++ b/src/radeon_dri2.c
 [...]
 @@ -613,36 +553,41 @@ xf86CrtcPtr radeon_dri2_drawable_crtc(DrawablePtr 
 pDraw, Bool consider_disabled)
 return NULL;
  }

 -void radeon_dri2_flip_event_handler(unsigned int frame, unsigned int tv_sec,
 -   unsigned int tv_usec, void *event_data)
 +static void
 +radeon_dri2_flip_event_abort(ScrnInfoPtr scrn, void *event_data)
 +{
 +free(event_data);
 +}
 +
 +static void
 +radeon_dri2_flip_event_handler(ScrnInfoPtr scrn, uint32_t frame, uint64_t 
 usec,
 +  void *event_data)
  {
  DRI2FrameEventPtr flip = event_data;
 +unsigned tv_sec, tv_usec;
  DrawablePtr drawable;
  ScreenPtr screen;
 -ScrnInfoPtr scrn;
  int status;
  PixmapPtr pixmap;

  status = dixLookupDrawable(drawable, flip-drawable_id, serverClient,
M_ANY, DixWriteAccess);
 -if (status != Success) {
 -   free(flip);
 -   return;
 -}
 -if (!flip-crtc) {
 -   free(flip);
 -   return;
 -}
 -frame += radeon_get_interpolated_vblanks(flip-crtc);
 +if (status != Success)
 +   goto abort;

 -screen = drawable-pScreen;
 -scrn = xf86ScreenToScrn(screen);
 +if (!flip-crtc)
 +   goto abort;
 +frame += radeon_get_interpolated_vblanks(flip-crtc);

 +screen = scrn-pScreen;
  pixmap = screen-GetScreenPixmap(screen);
  xf86DrvMsgVerb(scrn-scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG,
%s:%d fevent[%p] width %d pitch %d (/4 %d)\n,
__func__, __LINE__, flip, pixmap-drawable.width, 
 pixmap-devKind, pixmap-devKind/4);

 +tv_sec = usec / 1000;
 +tv_usec = usec % 1000;
 
 Looks like an extra '0' crept into these calculations.  Here we are
 dividing by 10^7 while everywhere else in this patch we use 10^6.

Indeed, thanks for the catch! Fixed in v3.


-- 
Earthling Michel Dänzer   |   http://www.amd.com
Libre software enthusiast | Mesa and X developer
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: cannot find -lX11

2015-03-16 Thread Sérgio Basto
On Seg, 2015-03-16 at 10:13 +, Roy Schofield wrote:
 Hi,
 Grateful for some help and/or assistance with X11 configuration on
 LinuxMint 17 Cinnamon.
 
 I have just upgraded from Linuxmint 16 Petra to LinuxMint 17 Cinnamon
 and have a problem compiling/linking  a program with Marinas-ide which
 is a dbase/clipper compiler. All worked fine with Linuxmint 16 but now
 get the following error when compiling/linking an existing source
 program. The error is as follows:
 
 
 
 == Linking to make /home/roy/Marinas_Progs/Invoice_print ...
 
 /usr/bin/gcc -o/home/roy/Marinas_Progs/Invoice_print
 -L/home/roy/marinas-ide/gui/lib -L/home/roy/marinas-ide/harbour/lib
 -L/home/roy/marinas-ide/qt/lib
 -L/usr/lib /home/roy/Marinas_Progs/__mih_obj_m3gh/Invoice_print.o 
 /home/roy/Marinas_Progs/__mih_obj_m3gh/Invoice_print_mg_hbmk2_cpp_functions_.o
  -Wl,--start-group -lmarinas-gui -lxhb -lhbct -lsupc++ -lhbextern -lhbdebug 
 -lhbvm -lhbrtl -lhblang -lhbcpage -lgtcgi -lgtpca -lgtstd -lgttrm -lgtxwc 
 -lhbrdd -lhbuddall -lhbusrrdd -lrddntx -lrddcdx -lrddnsx -lrddfpt -lhbrdd 
 -lhbhsx -lhbsix -lhbmacro -lhbcplr -lhbpp -lhbcommon -lm -ldl -lrt -lhbmzip 
 -lminizip -lhbziparc -lhbzlib -lhbtip -lhbxdiff -lxdiff -lhbpcre -lhbzebra 
 -lhbmxml -lmxml -lhbcairo -lhbcurl /home/roy/marinas-ide/libcurl-gnutls.so.4 
 /home/roy/marinas-ide/libldap_r-2.4.so.2.5.6 
 /home/roy/marinas-ide/liblber-2.4.so.2.5.6 
 /home/roy/marinas-ide/libsasl2.so.2.0.23 -lhbmysql 
 /home/roy/marinas-ide/libmysqlclient.so.16 -lhbssl -lhbqtcore -lhbqtgui 
 -lhbqtnetwork -lhbqtwebkit -Wl,--end-group -lQt5Core -lQt5Gui -lQt5Network 
 -lQt5WebKit -lQt5XmlPatterns -lQt5PrintSupport -lQt5WebKitWidgets 
 -lQt5Widgets -lX11 -lX11 
 
 /usr/bin/ld: cannot find -lX11 

Normally it means that you need install one devel package like :
libX11-devel
 
 
 Kind regards
 Roy
 
 
 
 -- 
 Working to achieve the long term economic sustainability of Caistor in 
 Lincolnshire by preserving, restoring and enhancing the historical, 
 architectural and cultural heritage of the town. For further information go 
 to http://www.caistor.net
 ___
 xorg@lists.x.org: X.Org support
 Archives: http://lists.freedesktop.org/archives/xorg
 Info: http://lists.x.org/mailman/listinfo/xorg
 Your subscription address: %(user_address)s

-- 
Sérgio M. B.

___
xorg@lists.x.org: X.Org support
Archives: http://lists.freedesktop.org/archives/xorg
Info: http://lists.x.org/mailman/listinfo/xorg
Your subscription address: %(user_address)s

Re: [PATCH:libx11] parse_omit_name should increase num of fields before appending encoding

2015-03-16 Thread Alan Coopersmith

On 03/15/15 11:39 PM, Hong Xu wrote:

parse_omit_name currently does not increase number of fields to 12 after
appending encoding, This does not lead to the correct font is a xlfd
like -*-*-medium-r-*-*-33-* is given.

Signed-off-by: Hong Xu h...@topbug.net

---
Please note that the if in this patch is replaced by while. The
reason is that I found the commit 3d69b0a83e62f8f6fbd changed the
while to if, which does not seems logically correct for me and
actually accidently fixed the bug
http://sourceware.org/bugzilla/show_bug.cgi?id=10948


Multiple people found and fixed that bug - I am not going to revert
the change and destroy performance without a better reason than one
person not understanding the fix.

It's not just the bug you cite, but was also a bug our Solaris i18n team
found and fixed:
   https://hg.java.net/hg/solaris-x11~x-s12-clone/rev/6fe48a3a12bf
and one Thomas Dickey found and fixed while investigating xterm performance:
   http://invisible-island.net/xterm/xterm.faq.html#slow_menus

--
-Alan Coopersmith-  alan.coopersm...@oracle.com
 Oracle Solaris Engineering - http://blogs.oracle.com/alanc
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

[PATCH 1/2] Add AC_SYS_LARGEFILE defines to dix-config.h

2015-03-16 Thread Michel Dänzer
From: Michel Dänzer michel.daen...@amd.com

Without this, AC_SYS_LARGEFILE doesn't actually have any effect.

Signed-off-by: Michel Dänzer mic...@daenzer.net
---
 include/dix-config.h.in | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/include/dix-config.h.in b/include/dix-config.h.in
index 1aa77a5..b0eb696 100644
--- a/include/dix-config.h.in
+++ b/include/dix-config.h.in
@@ -388,9 +388,15 @@
 /* Vendor name */
 #undef XVENDORNAME
 
+/* Number of bits in a file offset, on hosts where this is settable. */
+#undef _FILE_OFFSET_BITS
+
 /* Enable GNU and other extensions to the C environment for GLIBC */
 #undef _GNU_SOURCE
 
+/* Define for large files, on AIX-style hosts. */
+#undef _LARGE_FILES
+
 /* Define to empty if `const' does not conform to ANSI C. */
 #undef const
 
-- 
2.1.4

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: Strange issue with fglrx/opengl

2015-03-16 Thread Glynn Clements

Dwayne Rightler wrote:

 This one is puzzling me... any help would be great!
 
 glxinfo/glxgears does not work from my user account:
 
 darkomen@darkomen-desktop:~$ glxinfo
 name of display: :0
 Error: couldn't find RGB GLX visual or fbconfig
 
 darkomen@darkomen-desktop:~$ glxgears
 Error: couldn't get an RGB, Double-buffered visual
 
 
 If I give local permissions and su to root it works as root:

 root@darkomen-desktop:~# glxinfo
 name of display: :0
 display: :0  screen: 0
 direct rendering: No (If you want to find out why, try setting
 LIBGL_DEBUG=verbose)

 If I ssh into localhost as my normal user with X11 Forwarding it works:

 darkomen@darkomen-desktop:~$ glxinfo
 name of display: localhost:11.0
 display: localhost:11  screen: 0
 direct rendering: No (If you want to find out why, try setting
 LIBGL_DEBUG=verbose)

For another data point, try

export LIBGL_ALWAYS_INDIRECT=1

before running the glxinfo command.

It's possible that there's an issue which only affects direct
rendering. ssh -X localhost would prevent that (although I don't know
why running as root would; perhaps the issue is something in your
environment which is fixed by su - ... rather than by running as
root per se).

-- 
Glynn Clements gl...@gclements.plus.com
___
xorg@lists.x.org: X.Org support
Archives: http://lists.freedesktop.org/archives/xorg
Info: http://lists.x.org/mailman/listinfo/xorg
Your subscription address: %(user_address)s

[PATCH:libx11] parse_omit_name should increase num of fields before appending encoding

2015-03-16 Thread Hong Xu
parse_omit_name currently does not increase number of fields to 12 after
appending encoding, This does not lead to the correct font is a xlfd
like -*-*-medium-r-*-*-33-* is given.

Signed-off-by: Hong Xu h...@topbug.net

---
Please note that the if in this patch is replaced by while. The
reason is that I found the commit 3d69b0a83e62f8f6fbd changed the
while to if, which does not seems logically correct for me and
actually accidently fixed the bug
http://sourceware.org/bugzilla/show_bug.cgi?id=10948
---
 modules/om/generic/omGeneric.c | 30 ++
 1 file changed, 14 insertions(+), 16 deletions(-)

diff --git a/modules/om/generic/omGeneric.c b/modules/om/generic/omGeneric.c
index a835f00d7989..f447eb30ef78 100644
--- a/modules/om/generic/omGeneric.c
+++ b/modules/om/generic/omGeneric.c
@@ -808,6 +808,20 @@ parse_omit_name(
break;
 }
 
+last++;
+
+/* This may mot be needed anymore as XListFonts() takes care of this */
+while (num_fields  12) {
+   if ((last - buf)  (XLFD_MAX_LEN - 2))
+   return -1;
+   *last = '*';
+   *(last + 1) = '-';
+   num_fields++;
+   last+=2;
+   if ((font_data-xlfd_name = get_font_name(oc, buf)) != NULL)
+   return True;
+}
+
/* At this point, last is pointing to the last - in the
 * xlfd, and all xlfd's at this point take a form similar to:
 *   -*-*-*-*-*-*-14-*-*-*-*-*-
@@ -819,8 +833,6 @@ parse_omit_name(
 * we've found a match.
 */
 
-last++;
-
 if ((last - buf) + strlen(font_data-name)  XLFD_MAX_LEN)
return -1;
 
@@ -828,20 +840,6 @@ parse_omit_name(
 if ((font_data-xlfd_name = get_font_name(oc, buf)) != NULL)
return True;
 
-/* This may mot be needed anymore as XListFonts() takes care of this */
-if (num_fields  12) {
-   if ((last - buf)  (XLFD_MAX_LEN - 2))
-   return -1;
-   *last = '*';
-   *(last + 1) = '-';
-   strcpy(last + 2, font_data-name);
-   num_fields++;
-   last+=2;
-   if ((font_data-xlfd_name = get_font_name(oc, buf)) != NULL)
-   return True;
-}
-
-
 return False;
 }
 
-- 
2.3.3


___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH 0/14] DRI3 and Present support

2015-03-16 Thread Alex Deucher
On Thu, Mar 12, 2015 at 2:10 AM, Michel Dänzer mic...@daenzer.net wrote:
 Patches 1-10 and 13 are various cleanups and preparatory changes to make
 the main patches 11, 12 and 14 clearer.

 Because enabling DRI3 still causes some regressions on the client side
 (e.g. it breaks some piglit tests, probably due to bugs in the Gallium
 DRI state tracker code), it's guarded by Option DRI3 for now.

 It should work with EXA as well, but I've only tested glamor. Any testing
 with EXA appreciated.

Latest versions of the patches are:

Reviewed-by: Alex Deucher alexander.deuc...@amd.com


 [PATCH 01/14] Require at least xserver 1.8
 [PATCH 02/14] Move xorg_list backwards compatibility to new
 [PATCH 03/14] Add DRM event queue helpers
 [PATCH 04/14] DRI2: Simplify blit fallback handling for scheduled
 [PATCH 05/14] DRI2: Remove superfluous assignments to *_info-frame
 [PATCH 06/14] DRI2: Move radeon_dri2_flip_event_handler
 [PATCH 07/14] DRI2: Use helper functions for DRM event queue
 [PATCH 08/14] DRI2: Split out helper for getting UST and MSC of a
 [PATCH 09/14] Move #include radeon_glamor.h from radeon.h to where
 [PATCH 10/14] Fold radeon_glamor_flush into radeon_cs_flush_indirect
 [PATCH 11/14] Add support for the Present extension
 [PATCH 12/14] Add support for SYNC extension fences
 [PATCH 13/14] Handle tiling in radeon_set_shared_pixmap_backing
 [PATCH 14/14] Add DRI3 support
 ___
 xorg-driver-ati mailing list
 xorg-driver-ati@lists.x.org
 http://lists.x.org/mailman/listinfo/xorg-driver-ati
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-driver-ati


Adding DBus Support to a Driver?

2015-03-16 Thread Stirling Westrup
I currently maintain the commercial version of the SMSC driver. Recently
I've been asked to consider adding DBus support to the driver for such uses
as setting internal debug variables and inquiring about performance
statistics.

A quick look at the Xorg sources show that Xorg is DBus aware via its
dbus-core.c code, but that the interface to dbus-core is not currently
exported to the public include files.

How safe would it be to add my own dbus connection routines to my driver,
and ignore the ones in Xorg? Is this likely to cause any conflicts?


-- 
Stirling Westrup
Programmer, Entrepreneur.
https://www.linkedin.com/e/fpf/77228
http://www.linkedin.com/in/swestrup
http://technaut.livejournal.com
http://sourceforge.net/users/stirlingwestrup
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH 07/14] DRI2: Use helper functions for DRM event queue management

2015-03-16 Thread Richard Wilbur
On Thu, Mar 12, 2015 at 12:10 AM, Michel Dänzer mic...@daenzer.net wrote:
[...]
 diff --git a/src/radeon_dri2.c b/src/radeon_dri2.c
 index a3f0776..97164b6 100644
 --- a/src/radeon_dri2.c
 +++ b/src/radeon_dri2.c
[...]
 @@ -613,36 +553,41 @@ xf86CrtcPtr radeon_dri2_drawable_crtc(DrawablePtr 
 pDraw, Bool consider_disabled)
 return NULL;
  }

 -void radeon_dri2_flip_event_handler(unsigned int frame, unsigned int tv_sec,
 -   unsigned int tv_usec, void *event_data)
 +static void
 +radeon_dri2_flip_event_abort(ScrnInfoPtr scrn, void *event_data)
 +{
 +free(event_data);
 +}
 +
 +static void
 +radeon_dri2_flip_event_handler(ScrnInfoPtr scrn, uint32_t frame, uint64_t 
 usec,
 +  void *event_data)
  {
  DRI2FrameEventPtr flip = event_data;
 +unsigned tv_sec, tv_usec;
  DrawablePtr drawable;
  ScreenPtr screen;
 -ScrnInfoPtr scrn;
  int status;
  PixmapPtr pixmap;

  status = dixLookupDrawable(drawable, flip-drawable_id, serverClient,
M_ANY, DixWriteAccess);
 -if (status != Success) {
 -   free(flip);
 -   return;
 -}
 -if (!flip-crtc) {
 -   free(flip);
 -   return;
 -}
 -frame += radeon_get_interpolated_vblanks(flip-crtc);
 +if (status != Success)
 +   goto abort;

 -screen = drawable-pScreen;
 -scrn = xf86ScreenToScrn(screen);
 +if (!flip-crtc)
 +   goto abort;
 +frame += radeon_get_interpolated_vblanks(flip-crtc);

 +screen = scrn-pScreen;
  pixmap = screen-GetScreenPixmap(screen);
  xf86DrvMsgVerb(scrn-scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG,
%s:%d fevent[%p] width %d pitch %d (/4 %d)\n,
__func__, __LINE__, flip, pixmap-drawable.width, 
 pixmap-devKind, pixmap-devKind/4);

 +tv_sec = usec / 1000;
 +tv_usec = usec % 1000;

Looks like an extra '0' crept into these calculations.  Here we are
dividing by 10^7 while everywhere else in this patch we use 10^6.
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-driver-ati


Re: [PATCH util-modular 1/3] xorg.modules: Add libevdev requirement to synaptics

2015-03-16 Thread Gaetan Nadon
On 15-03-15 06:47 PM, Peter Hutterer wrote:
 Signed-off-by: Peter Hutterer peter.hutte...@who-t.net
 ---
  xorg.modules | 1 +
  1 file changed, 1 insertion(+)

 diff --git a/xorg.modules b/xorg.modules
 index 7216192..6d80c6b 100644
 --- a/xorg.modules
 +++ b/xorg.modules
 @@ -1974,6 +1974,7 @@
dep package=libX11/
dep package=libXi/
dep package=xserver/
 +  dep package=libevdev/
  /dependencies
/autotools
  

Should we not preserve the comment as well? Unless of course it was
wrong in the first place.
This helps those customizing the list and saves them from debugging
build problems on non Linux platforms.

-  dep package=libevdev/ !-- Linux 
Only --


___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

[PATCH 1/2] Make PseudoramiXExtensionInit() prototype more generally available

2015-03-16 Thread Jon TURNEY
Make PseudoramiXExtensionInit() prototype available to hw/xwin

Rather than avoiding a reference to it being pulled in to Xorg by sdksyms by
hiding this prototype behind the INXQUARTZ define, which is only defined when
building Xquartz, introduce nonsdk_extinit.h and move it there.

(The only remaining use of INXQUARTZ is in mi/miiniext.c, in order
to do PseudoramiXExtensionInit() at the point apparently needed by Xquartz)

Also remove duplicate declaration of noPseudoramiXExtension from pseudoramiX.h

Signed-off-by: Jon TURNEY jon.tur...@dronecode.org.uk
---
 hw/xquartz/quartz.c   |  1 +
 include/Makefile.am   |  1 +
 include/extinit.h |  5 -
 include/nonsdk_extinit.h  | 35 +++
 pseudoramiX/pseudoramiX.c |  2 +-
 pseudoramiX/pseudoramiX.h |  2 --
 6 files changed, 38 insertions(+), 8 deletions(-)
 create mode 100644 include/nonsdk_extinit.h

diff --git a/hw/xquartz/quartz.c b/hw/xquartz/quartz.c
index d7229ce..851ce48 100644
--- a/hw/xquartz/quartz.c
+++ b/hw/xquartz/quartz.c
@@ -43,6 +43,7 @@
 #include darwinEvents.h
 #include pseudoramiX.h
 #include extension.h
+#include nonsdk_extinit.h
 #include glx_extinit.h
 #define _APPLEWM_SERVER_
 #include applewmExt.h
diff --git a/include/Makefile.am b/include/Makefile.am
index 168b00f..738b582 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -33,6 +33,7 @@ sdk_HEADERS = \
misc.h  \
miscstruct.h\
opaque.h\
+   nonsdk_extinit.h\
optionstr.h \
os.h\
pixmap.h\
diff --git a/include/extinit.h b/include/extinit.h
index fa5f293..4ad4fca 100644
--- a/include/extinit.h
+++ b/include/extinit.h
@@ -163,11 +163,6 @@ extern void SELinuxExtensionInit(void);
 extern void XTestExtensionInit(void);
 #endif
 
-#ifdef INXQUARTZ
-extern _X_EXPORT Bool noPseudoramiXExtension;
-extern void PseudoramiXExtensionInit(void);
-#endif
-
 #if defined(XV)
 #include X11/extensions/Xv.h
 #include X11/extensions/XvMC.h
diff --git a/include/nonsdk_extinit.h b/include/nonsdk_extinit.h
new file mode 100644
index 000..da8d370
--- /dev/null
+++ b/include/nonsdk_extinit.h
@@ -0,0 +1,35 @@
+/***
+
+Copyright 2014 Jon TURNEY
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the Software),
+to deal in the Software without restriction, including without limitation
+the rights to use, copy, modify, merge, publish, distribute, sublicense,
+and/or sell copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice (including the next
+paragraph) shall be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
+
+**/
+
+#ifndef NONSDK_EXT_INIT_H
+#define NONSDK_EXT_INIT_H
+
+/* this is separate from extinit.h to avoid references to these symbols being
+   pulled in by sdksyms */
+
+extern _X_EXPORT Bool noPseudoramiXExtension;
+extern void PseudoramiXExtensionInit(void);
+
+#endif
diff --git a/pseudoramiX/pseudoramiX.c b/pseudoramiX/pseudoramiX.c
index f47c783..d0e2603 100644
--- a/pseudoramiX/pseudoramiX.c
+++ b/pseudoramiX/pseudoramiX.c
@@ -39,7 +39,7 @@
 
 #include pseudoramiX.h
 #include extnsionst.h
-#include extinit.h
+#include nonsdk_extinit.h
 #include dixstruct.h
 #include window.h
 #include X11/extensions/panoramiXproto.h
diff --git a/pseudoramiX/pseudoramiX.h b/pseudoramiX/pseudoramiX.h
index f063919..5393062 100644
--- a/pseudoramiX/pseudoramiX.h
+++ b/pseudoramiX/pseudoramiX.h
@@ -2,8 +2,6 @@
  * Minimal implementation of PanoramiX/Xinerama
  */
 
-extern int noPseudoramiXExtension;
-
 void
 PseudoramiXAddScreen(int x, int y, int w, int h);
 void
-- 
2.1.4

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

[PATCH 0/2] PseudoramiX patches

2015-03-16 Thread Jon TURNEY
Jon TURNEY (2):
  Make PseudoramiXExtensionInit() prototype more generally available
  Don't allow both RandR XINERAMA and pseudoramiX XINERAMA extensions to
register

 hw/xquartz/quartz.c   |  1 +
 include/Makefile.am   |  1 +
 include/extinit.h |  5 -
 include/nonsdk_extinit.h  | 35 +++
 pseudoramiX/pseudoramiX.c |  6 +-
 pseudoramiX/pseudoramiX.h |  2 --
 randr/rrxinerama.c|  5 +
 7 files changed, 47 insertions(+), 8 deletions(-)
 create mode 100644 include/nonsdk_extinit.h

-- 
2.1.4

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

[PATCH 2/2] Don't allow both RandR XINERAMA and pseudoramiX XINERAMA extensions to register

2015-03-16 Thread Jon TURNEY
Prevent RRXinerama from activating if PseudoramiX is, so we don't get XINERAMA
listed twice in the list of extensions.  I think this is otherwise benign, as
the PseudoramiX XINERAMA gets registered first and thus handles all requests.

Perhaps AddExtension() ought to warn us if the extension name is already
registered?

This appears to be a long-standing bug seen in XQuartz, and now in XWin as well.

XXX: Perhaps since RRXinerama isn't actually doing anything useful but faking it
when we have one screen, it seems that the PseudoramiX code could be also used
in that case.

Signed-off-by: Jon TURNEY jon.tur...@dronecode.org.uk
---
 pseudoramiX/pseudoramiX.c | 4 
 randr/rrxinerama.c| 5 +
 2 files changed, 9 insertions(+)

diff --git a/pseudoramiX/pseudoramiX.c b/pseudoramiX/pseudoramiX.c
index d0e2603..e59ca13 100644
--- a/pseudoramiX/pseudoramiX.c
+++ b/pseudoramiX/pseudoramiX.c
@@ -49,6 +49,7 @@
 #define DEBUG_LOG PseudoramiXDebug
 
 Bool noPseudoramiXExtension = FALSE;
+extern Bool noRRXineramaExtension;
 
 extern int
 ProcPanoramiXQueryVersion(ClientPtr client);
@@ -190,6 +191,9 @@ PseudoramiXExtensionInit(void)
 }
 }
 
+/* Do not allow RRXinerama to initialize if we did */
+noRRXineramaExtension = success;
+
 if (!success) {
 ErrorF(%s Extension (PseudoramiX) failed to initialize\n,
PANORAMIX_PROTOCOL_NAME);
diff --git a/randr/rrxinerama.c b/randr/rrxinerama.c
index b336bd7..36632c7 100644
--- a/randr/rrxinerama.c
+++ b/randr/rrxinerama.c
@@ -84,6 +84,8 @@ static int ProcRRXineramaIsActive(ClientPtr client);
 static int ProcRRXineramaQueryScreens(ClientPtr client);
 static int SProcRRXineramaDispatch(ClientPtr client);
 
+Bool noRRXineramaExtension = FALSE;
+
 /* Proc */
 
 int
@@ -488,6 +490,9 @@ RRXineramaExtensionInit(void)
 return;
 #endif
 
+if (noRRXineramaExtension)
+  return;
+
 /*
  * Xinerama isn't capable enough to have multiple protocol screens each
  * with their own output geometry.  So if there's more than one protocol
-- 
2.1.4

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH 07/14] DRI2: Use helper functions for DRM event queue management

2015-03-16 Thread Richard Wilbur
I'm glad I was able to help.

Thanks to you and the others for all your hard work maintaining and
improving these free software drivers.  I appreciate the chance to
read the code, ask questions, and learn.
___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-driver-ati


[PATCH xf86-input-libinput 1/2] Add a helper function for making properties

2015-03-16 Thread Peter Hutterer
Signed-off-by: Peter Hutterer peter.hutte...@who-t.net
---
 src/libinput.c | 212 ++---
 1 file changed, 80 insertions(+), 132 deletions(-)

diff --git a/src/libinput.c b/src/libinput.c
index 5f2bd34..1eadbc7 100644
--- a/src/libinput.c
+++ b/src/libinput.c
@@ -1727,23 +1727,44 @@ LibinputSetProperty(DeviceIntPtr dev, Atom atom, 
XIPropertyValuePtr val,
return rc;
 }
 
+static Atom
+LibinputMakeProperty(DeviceIntPtr dev,
+const char *prop_name,
+Atom type,
+int format,
+int len,
+void *data)
+{
+   int rc;
+   Atom prop = MakeAtom(prop_name, strlen(prop_name), TRUE);
+
+   rc = XIChangeDeviceProperty(dev, prop, type, format,
+   PropModeReplace,
+   len, data, FALSE);
+   if (rc != Success)
+   return None;
+
+   XISetDevicePropertyDeletable(dev, prop, FALSE);
+
+   return prop;
+}
+
 static void
 LibinputInitTapProperty(DeviceIntPtr dev,
struct xf86libinput *driver_data,
struct libinput_device *device)
 {
BOOL tap = driver_data-options.tapping;
-   int rc;
 
if (libinput_device_config_tap_get_finger_count(device) == 0)
return;
 
-   prop_tap = MakeAtom(LIBINPUT_PROP_TAP, strlen(LIBINPUT_PROP_TAP), TRUE);
-   rc = XIChangeDeviceProperty(dev, prop_tap, XA_INTEGER, 8,
-   PropModeReplace, 1, tap, FALSE);
-   if (rc != Success)
-   return;
-   XISetDevicePropertyDeletable(dev, prop_tap, FALSE);
+   prop_tap = LibinputMakeProperty(dev,
+   LIBINPUT_PROP_TAP,
+   XA_INTEGER,
+   8,
+   1,
+   tap);
 }
 
 static void
@@ -1752,7 +1773,6 @@ LibinputInitCalibrationProperty(DeviceIntPtr dev,
struct libinput_device *device)
 {
float calibration[9];
-   int rc;
 
if (!libinput_device_config_calibration_has_matrix(device))
return;
@@ -1765,15 +1785,10 @@ LibinputInitCalibrationProperty(DeviceIntPtr dev,
calibration[7] = 0;
calibration[8] = 1;
 
-   prop_calibration = MakeAtom(LIBINPUT_PROP_CALIBRATION,
-   strlen(LIBINPUT_PROP_CALIBRATION),
-   TRUE);
-
-   rc = XIChangeDeviceProperty(dev, prop_calibration, prop_float, 32,
-   PropModeReplace, 9, calibration, FALSE);
-   if (rc != Success)
-   return;
-   XISetDevicePropertyDeletable(dev, prop_calibration, FALSE);
+   prop_calibration = LibinputMakeProperty(dev,
+   LIBINPUT_PROP_CALIBRATION,
+   prop_float, 32,
+   9, calibration);
 }
 
 static void
@@ -1782,17 +1797,14 @@ LibinputInitAccelProperty(DeviceIntPtr dev,
  struct libinput_device *device)
 {
float speed = driver_data-options.speed;
-   int rc;
 
if (!libinput_device_config_accel_is_available(device))
return;
 
-   prop_accel = MakeAtom(LIBINPUT_PROP_ACCEL, strlen(LIBINPUT_PROP_ACCEL), 
TRUE);
-   rc = XIChangeDeviceProperty(dev, prop_accel, prop_float, 32,
-   PropModeReplace, 1, speed, FALSE);
-   if (rc != Success)
-   return;
-   XISetDevicePropertyDeletable(dev, prop_accel, FALSE);
+   prop_accel = LibinputMakeProperty(dev,
+ LIBINPUT_PROP_ACCEL,
+ prop_float, 32,
+ 1, speed);
 }
 
 static void
@@ -1801,19 +1813,14 @@ LibinputInitNaturalScrollProperty(DeviceIntPtr dev,
  struct libinput_device *device)
 {
BOOL natural_scroll = driver_data-options.natural_scrolling;
-   int rc;
 
if (!libinput_device_config_scroll_has_natural_scroll(device))
return;
 
-   prop_natural_scroll = MakeAtom(LIBINPUT_PROP_NATURAL_SCROLL,
-  strlen(LIBINPUT_PROP_NATURAL_SCROLL),
-  TRUE);
-   rc = XIChangeDeviceProperty(dev, prop_natural_scroll, XA_INTEGER, 8,
-   PropModeReplace, 1, natural_scroll, FALSE);
-   if (rc != Success)
-   return;
-   XISetDevicePropertyDeletable(dev, prop_natural_scroll, FALSE);
+   prop_natural_scroll = LibinputMakeProperty(dev,
+  LIBINPUT_PROP_NATURAL_SCROLL,
+ 

[PATCH xf86-input-libinput 2/2] Add libinput something Default properties

2015-03-16 Thread Peter Hutterer
A client or xorg.conf setting may change the property but once changed it
cannot be reset by a client to the original state without knowledge about the
device.

Export the various libinput_...get_default() functions as properties.

https://bugs.freedesktop.org/show_bug.cgi?id=89574

Signed-off-by: Peter Hutterer peter.hutte...@who-t.net
---
 include/libinput-properties.h |  29 ++
 src/libinput.c| 124 +-
 2 files changed, 152 insertions(+), 1 deletion(-)

diff --git a/include/libinput-properties.h b/include/libinput-properties.h
index 1d7b416..8947126 100644
--- a/include/libinput-properties.h
+++ b/include/libinput-properties.h
@@ -27,15 +27,27 @@
 /* Tapping enabled/disabled: BOOL, 1 value */
 #define LIBINPUT_PROP_TAP libinput Tapping Enabled
 
+/* Tapping default enabled/disabled: BOOL, 1 value, read-only */
+#define LIBINPUT_PROP_TAP_DEFAULT libinput Tapping Enabled Default
+
 /* Calibration matrix: FLOAT, 9 values of a 3x3 matrix, in rows */
 #define LIBINPUT_PROP_CALIBRATION libinput Calibration Matrix
 
+/* Calibration matrix: FLOAT, 9 values of a 3x3 matrix, in rows, read-only*/
+#define LIBINPUT_PROP_CALIBRATION_DEFAULT libinput Calibration Matrix Default
+
 /* Pointer accel speed: FLOAT, 1 value, 32 bit */
 #define LIBINPUT_PROP_ACCEL libinput Accel Speed
 
+/* Pointer accel speed: FLOAT, 1 value, 32 bit, read-only*/
+#define LIBINPUT_PROP_ACCEL_DEFAULT libinput Accel Speed Default
+
 /* Natural scrolling: BOOL, 1 value */
 #define LIBINPUT_PROP_NATURAL_SCROLL libinput Natural Scrolling Enabled
 
+/* Natural scrolling: BOOL, 1 value, read-only */
+#define LIBINPUT_PROP_NATURAL_SCROLL_DEFAULT libinput Natural Scrolling 
Enabled Default
+
 /* Send-events mode: BOOL read-only, 2 values in order disabled,
disabled-on-external-mouse */
 #define LIBINPUT_PROP_SENDEVENTS_AVAILABLE libinput Send Events Modes 
Available
@@ -44,9 +56,16 @@
disabled-on-external-mouse */
 #define LIBINPUT_PROP_SENDEVENTS_ENABLED libinput Send Events Mode Enabled
 
+/* Send-events mode: BOOL, 2 values in order disabled,
+   disabled-on-external-mouse, read-only */
+#define LIBINPUT_PROP_SENDEVENTS_ENABLED_DEFAULT libinput Send Events Mode 
Enabled Default
+
 /* Left-handed enabled/disabled: BOOL, 1 value */
 #define LIBINPUT_PROP_LEFT_HANDED libinput Left Handed Enabled
 
+/* Left-handed enabled/disabled: BOOL, 1 value, read-only */
+#define LIBINPUT_PROP_LEFT_HANDED_DEFAULT libinput Left Handed Enabled 
Default
+
 /* Scroll method: BOOL read-only, 3 values in order 2fg, edge, button.
shows available scroll methods */
 #define LIBINPUT_PROP_SCROLL_METHODS_AVAILABLE libinput Scroll Methods 
Available
@@ -55,9 +74,16 @@
only one is enabled at a time at max */
 #define LIBINPUT_PROP_SCROLL_METHOD_ENABLED libinput Scroll Method Enabled
 
+/* Scroll method: BOOL, 3 values in order 2fg, edge, button
+   only one is enabled at a time at max, read-only */
+#define LIBINPUT_PROP_SCROLL_METHOD_ENABLED_DEFAULT libinput Scroll Method 
Enabled Default
+
 /* Scroll button for button scrolling: 32-bit int, 1 value */
 #define LIBINPUT_PROP_SCROLL_BUTTON libinput Button Scrolling Button
 
+/* Scroll button for button scrolling: 32-bit int, 1 value, read-only */
+#define LIBINPUT_PROP_SCROLL_BUTTON_DEFAULT libinput Button Scrolling Button 
Default
+
 /* Click method: BOOL read-only, 2 values in order buttonareas, clickfinger
shows available click methods */
 #define LIBINPUT_PROP_CLICK_METHODS_AVAILABLE libinput Click Methods 
Available
@@ -66,4 +92,7 @@
only one enabled at a time at max */
 #define LIBINPUT_PROP_CLICK_METHOD_ENABLED libinput Click Method Enabled
 
+/* Click method: BOOL, 2 values in order buttonareas, clickfinger
+   only one enabled at a time at max, read-only */
+#define LIBINPUT_PROP_CLICK_METHOD_ENABLED_DEFAULT libinput Click Method 
Enabled Default
 #endif /* _LIBINPUT_PROPERTIES_H_ */
diff --git a/src/libinput.c b/src/libinput.c
index 1eadbc7..8e0aab5 100644
--- a/src/libinput.c
+++ b/src/libinput.c
@@ -1327,17 +1327,26 @@ _X_EXPORT XF86ModuleData libinputModuleData = {
 
 /* libinput-specific properties */
 static Atom prop_tap;
+static Atom prop_tap_default;
 static Atom prop_calibration;
+static Atom prop_calibration_default;
 static Atom prop_accel;
+static Atom prop_accel_default;
 static Atom prop_natural_scroll;
+static Atom prop_natural_scroll_default;
 static Atom prop_sendevents_available;
 static Atom prop_sendevents_enabled;
+static Atom prop_sendevents_default;
 static Atom prop_left_handed;
+static Atom prop_left_handed_default;
 static Atom prop_scroll_methods_available;
 static Atom prop_scroll_method_enabled;
+static Atom prop_scroll_method_default;
 static Atom prop_scroll_button;
+static Atom prop_scroll_button_default;
 static Atom prop_click_methods_available;
 static Atom prop_click_method_enabled;
+static Atom prop_click_method_default;
 
 /* general properties */
 static Atom prop_float;
@@ -1716,7 +1725,16 

Re: cannot find -lX11

2015-03-16 Thread Chris Sorenson
 
 -L/home/roy/marinas-ide/qt/lib -L/usr/lib
 

There's the bad right there, libX11 must be somewhere other
than /usr/lib. Find out where it is and change that entry in
the Makefile. (If you really have no idea where it is, do
this: find / -name libX11\* could take a while as that will
search the entire filesystem. If you're sure it's in /lib
do: find /lib -name libX11\* good luck!). 

___
xorg@lists.x.org: X.Org support
Archives: http://lists.freedesktop.org/archives/xorg
Info: http://lists.x.org/mailman/listinfo/xorg
Your subscription address: %(user_address)s

Re: Adding DBus Support to a Driver?

2015-03-16 Thread Peter Hutterer
On Mon, Mar 16, 2015 at 10:57:50AM -0400, Stirling Westrup wrote:
 I currently maintain the commercial version of the SMSC driver. Recently
 I've been asked to consider adding DBus support to the driver for such uses
 as setting internal debug variables and inquiring about performance
 statistics.
 
 A quick look at the Xorg sources show that Xorg is DBus aware via its
 dbus-core.c code, but that the interface to dbus-core is not currently
 exported to the public include files.
 
 How safe would it be to add my own dbus connection routines to my driver,
 and ignore the ones in Xorg? Is this likely to cause any conflicts?

Without having tried it myself, I'd say it's fine. dbus gives you an fd back
that you can add to the select loop and go from there.

Cheers,
  Peter
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH 3/4] modesetting: Use load_cursor_argb_check for sw cursor fallback

2015-03-16 Thread Kenneth Graunke
On Monday, February 16, 2015 05:00:54 PM Takashi Iwai wrote:
 The modesetting driver still has an everlasting bug of invisible
 cursor on cirrus and other KMS drivers where no hardware cursor is
 supported.  This patch is a part of an attempt to address it.
 
 This patch particularly converts the current load_cursor_argb callback
 of modesetting driver to load_cursor_argb_check so that it can return
 whether the driver handles the hw cursor or falls back to the sw
 cursor.
 
 Signed-off-by: Takashi Iwai ti...@suse.de
 ---
  hw/xfree86/drivers/modesetting/drmmode_display.c | 17 +++--
  1 file changed, 11 insertions(+), 6 deletions(-)
 
 diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c 
 b/hw/xfree86/drivers/modesetting/drmmode_display.c
 index 25d16a233103..25e4d367de46 100644
 --- a/hw/xfree86/drivers/modesetting/drmmode_display.c
 +++ b/hw/xfree86/drivers/modesetting/drmmode_display.c
 @@ -409,7 +409,7 @@ drmmode_set_cursor_position(xf86CrtcPtr crtc, int x, int 
 y)
  drmModeMoveCursor(drmmode-fd, drmmode_crtc-mode_crtc-crtc_id, x, y);
  }
  

Could we add a comment indicating what the boolean return value means?
Something like:

/**
 * The load_cursor_argb_check driver hook.
 *
 * Sets the hardware cursor by calling the drmModeSetCursor2 ioctl.
 * On failure, returns FALSE indicating that the X server should fall
 * back to software cursors.
 */

I had to chase through several layers of code to figure out whether
this boolean value matched the expectations of the driver hook it was
implementating.  I found no comments at any point, but eventually found
the answer via git blame and reading the commit message of 901fbfbbbd.
And it does indeed match!

Hopefully adding a comment will save people time in the future.

With that added, patches 2-3 are:
Reviewed-by: Kenneth Graunke kenn...@whitecape.org

I don't feel qualified to review patch 4.

 -static void
 +static Bool
  drmmode_set_cursor(xf86CrtcPtr crtc)
  {
  drmmode_crtc_private_ptr drmmode_crtc = crtc-driver_private;
 @@ -430,7 +430,7 @@ drmmode_set_cursor(xf86CrtcPtr crtc)
  if (ret)
  use_set_cursor2 = FALSE;
  else
 -return;
 +return TRUE;
  }
  
  ret = drmModeSetCursor(drmmode-fd, drmmode_crtc-mode_crtc-crtc_id, 
 handle,
 @@ -443,11 +443,15 @@ drmmode_set_cursor(xf86CrtcPtr crtc)
  cursor_info-MaxWidth = cursor_info-MaxHeight = 0;
  drmmode_crtc-drmmode-sw_cursor = TRUE;
  /* fallback to swcursor */
 +return FALSE;
  }
 +return TRUE;
  }
  
 -static void
 -drmmode_load_cursor_argb(xf86CrtcPtr crtc, CARD32 *image)
 +static void drmmode_hide_cursor(xf86CrtcPtr crtc);
 +
 +static Bool
 +drmmode_load_cursor_argb_check(xf86CrtcPtr crtc, CARD32 *image)
  {
  modesettingPtr ms = modesettingPTR(crtc-scrn);
  drmmode_crtc_private_ptr drmmode_crtc = crtc-driver_private;
 @@ -461,7 +465,8 @@ drmmode_load_cursor_argb(xf86CrtcPtr crtc, CARD32 *image)
  ptr[i] = image[i];  // cpu_to_le32(image[i]);
  
  if (drmmode_crtc-cursor_up)
 -drmmode_set_cursor(crtc);
 +return drmmode_set_cursor(crtc);
 +return TRUE;
  }
  
  static void
 @@ -665,7 +670,7 @@ static const xf86CrtcFuncsRec drmmode_crtc_funcs = {
  .set_cursor_position = drmmode_set_cursor_position,
  .show_cursor = drmmode_show_cursor,
  .hide_cursor = drmmode_hide_cursor,
 -.load_cursor_argb = drmmode_load_cursor_argb,
 +.load_cursor_argb_check = drmmode_load_cursor_argb_check,
  
  .gamma_set = drmmode_crtc_gamma_set,
  .destroy = NULL,/* XXX */
 


signature.asc
Description: This is a digitally signed message part.
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: cannot find -lX11

2015-03-16 Thread Maarten Maathuis
Have you attempted to locate libX11.so in your filesystem?

On Mon, Mar 16, 2015 at 11:13 AM, Roy Schofield r...@caistor.net wrote:

  Hi,
 Grateful for some help and/or assistance with X11 configuration on
 LinuxMint 17 Cinnamon.

 I have just upgraded from Linuxmint 16 Petra to LinuxMint 17 Cinnamon and
 have a problem compiling/linking  a program with Marinas-ide which is a
 dbase/clipper compiler. All worked fine with Linuxmint 16 but now get the
 following error when compiling/linking an existing source program. The
 error is as follows:

 == Linking to make /home/roy/Marinas_Progs/Invoice_print ...

 /usr/bin/gcc -o/home/roy/Marinas_Progs/Invoice_print
 -L/home/roy/marinas-ide/gui/lib -L/home/roy/marinas-ide/harbour/lib
 -L/home/roy/marinas-ide/qt/lib -L/usr/lib
 /home/roy/Marinas_Progs/__mih_obj_m3gh/Invoice_print.o
 /home/roy/Marinas_Progs/__mih_obj_m3gh/Invoice_print_mg_hbmk2_cpp_functions_.o
 -Wl,--start-group -lmarinas-gui -lxhb -lhbct -lsupc++ -lhbextern -lhbdebug
 -lhbvm -lhbrtl -lhblang -lhbcpage -lgtcgi -lgtpca -lgtstd -lgttrm -lgtxwc
 -lhbrdd -lhbuddall -lhbusrrdd -lrddntx -lrddcdx -lrddnsx -lrddfpt -lhbrdd
 -lhbhsx -lhbsix -lhbmacro -lhbcplr -lhbpp -lhbcommon -lm -ldl -lrt -lhbmzip
 -lminizip -lhbziparc -lhbzlib -lhbtip -lhbxdiff -lxdiff -lhbpcre -lhbzebra
 -lhbmxml -lmxml -lhbcairo -lhbcurl
 /home/roy/marinas-ide/libcurl-gnutls.so.4
 /home/roy/marinas-ide/libldap_r-2.4.so.2.5.6
 /home/roy/marinas-ide/liblber-2.4.so.2.5.6
 /home/roy/marinas-ide/libsasl2.so.2.0.23 -lhbmysql
 /home/roy/marinas-ide/libmysqlclient.so.16 -lhbssl -lhbqtcore -lhbqtgui
 -lhbqtnetwork -lhbqtwebkit -Wl,--end-group -lQt5Core -lQt5Gui -lQt5Network
 -lQt5WebKit -lQt5XmlPatterns -lQt5PrintSupport -lQt5WebKitWidgets
 -lQt5Widgets -lX11 -lX11

 /usr/bin/ld: cannot find -lX11


 Kind regards
 Roy

 --
 Working to achieve the long term economic sustainability of Caistor in 
 Lincolnshire by preserving, restoring and enhancing the historical, 
 architectural and cultural heritage of the town. For further information go 
 to http://www.caistor.net


 ___
 xorg@lists.x.org: X.Org support
 Archives: http://lists.freedesktop.org/archives/xorg
 Info: http://lists.x.org/mailman/listinfo/xorg
 Your subscription address: %(user_address)s




-- 
Far away from the primal instinct, the song seems to fade away, the river
get wider between your thoughts and the things we do and say.
___
xorg@lists.x.org: X.Org support
Archives: http://lists.freedesktop.org/archives/xorg
Info: http://lists.x.org/mailman/listinfo/xorg
Your subscription address: %(user_address)s

[PATCH 14/14] Add DRI3 support v2

2015-03-16 Thread Michel Dänzer
From: Michel Dänzer michel.daen...@amd.com

Must be enabled with

Option  DRI3

in xorg.conf.

v2: Adapt to v2 of patches 11/12.
Signed-off-by: Michel Dänzer michel.daen...@amd.com
---
 configure.ac  |   4 ++
 man/radeon.man|   4 ++
 src/Makefile.am   |   5 +-
 src/radeon.h  |   4 ++
 src/radeon_dri3.c | 201 ++
 src/radeon_kms.c  |  21 +-
 6 files changed, 236 insertions(+), 3 deletions(-)
 create mode 100644 src/radeon_dri3.c

diff --git a/configure.ac b/configure.ac
index 71d8ff0..acd9fe0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -143,6 +143,10 @@ AC_CHECK_HEADERS([present.h], [], [],
 #include X11/X.h
 #include xorg-server.h])
 
+AC_CHECK_HEADERS([dri3.h], [], [],
+[#include X11/Xmd.h
+#include xorg-server.h])
+
 CPPFLAGS=$SAVE_CPPFLAGS
 
 PKG_CHECK_MODULES([PCIACCESS], [pciaccess = 0.8.0])
diff --git a/man/radeon.man b/man/radeon.man
index 7dde040..6e46f89 100644
--- a/man/radeon.man
+++ b/man/radeon.man
@@ -267,6 +267,10 @@ The default value is
 for R/RV6XX, R/RV7XX, RS780, RS880, EVERGREEN, CAYMAN, ARUBA, Southern 
Islands, and
 Sea Islands.
 .TP
+.BI Option \*qDRI3\*q \*q boolean \*q
+Enable the DRI3 extension. The default is
+.B off.
+.TP
 .BI Option \*qEnablePageFlip\*q \*q boolean \*q
 Enable DRI2 page flipping.  The default is
 .B on.
diff --git a/src/Makefile.am b/src/Makefile.am
index a3d732a..697c08c 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -29,8 +29,9 @@
 ati_drv_la_LIBADD = $(PCIACCESS_LIBS)
 radeon_drv_la_LIBADD = $(LIBDRM_RADEON_LIBS) $(PCIACCESS_LIBS)
 
-RADEON_KMS_SRCS=radeon_dri2.c radeon_drm_queue.c radeon_kms.c radeon_present.c 
\
-   radeon_sync.c radeon_vbo.c radeon_bo_helper.c drmmode_display.c
+RADEON_KMS_SRCS=radeon_dri2.c radeon_dri3.c radeon_drm_queue.c radeon_kms.c \
+   radeon_present.c radeon_sync.c radeon_vbo.c radeon_bo_helper.c \
+   drmmode_display.c
 
 RADEON_EXA_SOURCES = radeon_exa.c r600_exa.c r6xx_accel.c 
r600_textured_videofuncs.c r600_shader.c radeon_exa_shared.c \
evergreen_exa.c evergreen_accel.c evergreen_shader.c 
evergreen_textured_videofuncs.c cayman_accel.c cayman_shader.c
diff --git a/src/radeon.h b/src/radeon.h
index 9346fbd..6084cfe 100644
--- a/src/radeon.h
+++ b/src/radeon.h
@@ -150,6 +150,7 @@ typedef enum {
 OPTION_ZAPHOD_HEADS,
 OPTION_SWAPBUFFERS_WAIT,
 OPTION_DELETE_DP12,
+OPTION_DRI3,
 } RADEONOpts;
 
 
@@ -549,6 +550,9 @@ extern Bool RADEONGetDatatypeBpp(int bpp, uint32_t *type);
 extern Bool RADEONGetPixmapOffsetPitch(PixmapPtr pPix,
   uint32_t *pitch_offset);
 
+/* radeon_dri3.c */
+Bool radeon_dri3_screen_init(ScreenPtr screen);
+
 /* radeon_present.c */
 Bool radeon_present_screen_init(ScreenPtr screen);
 
diff --git a/src/radeon_dri3.c b/src/radeon_dri3.c
new file mode 100644
index 000..83bffae
--- /dev/null
+++ b/src/radeon_dri3.c
@@ -0,0 +1,201 @@
+/*
+ * Copyright © 2013-2014 Intel Corporation
+ * Copyright © 2015 Advanced Micro Devices, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting documentation, and
+ * that the name of the copyright holders not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  The copyright holders make no representations
+ * about the suitability of this software for any purpose.  It is provided as
+ * is without express or implied warranty.
+ *
+ * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+
+#ifdef HAVE_CONFIG_H
+#include config.h
+#endif
+
+#include xorg-server.h
+#include xf86.h
+#include fb.h
+
+#ifdef HAVE_DRI3_H
+
+#include radeon.h
+#include radeon_bo_gem.h
+#include radeon_glamor.h
+#include dri3.h
+
+#include sys/types.h
+#include sys/stat.h
+#include fcntl.h
+#include errno.h
+
+
+static int
+radeon_dri3_open_client(ClientPtr client,
+   ScreenPtr screen,
+   RRProviderPtr provider,
+   int *out)
+{
+   ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
+   RADEONInfoPtr info = RADEONPTR(scrn);
+   drm_magic_t magic;
+   int fd;
+
+   fd = open(info-dri2.device_name, O_RDWR | O_CLOEXEC);
+   if (fd  0)
+ 

Re: [PATCH util-modular 1/3] xorg.modules: Add libevdev requirement to synaptics

2015-03-16 Thread Hans de Goede

Hi Peter,

On 15-03-15 23:47, Peter Hutterer wrote:

Signed-off-by: Peter Hutterer peter.hutte...@who-t.net


All 3 patches look good to me and are:

Reviewed-by: Hans de Goede hdego...@redhat.com

Regards,

Hans


---
  xorg.modules | 1 +
  1 file changed, 1 insertion(+)

diff --git a/xorg.modules b/xorg.modules
index 7216192..6d80c6b 100644
--- a/xorg.modules
+++ b/xorg.modules
@@ -1974,6 +1974,7 @@
dep package=libX11/
dep package=libXi/
dep package=xserver/
+  dep package=libevdev/
  /dependencies
/autotools



___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel