Re: [PATCH 1/4] modesetting: Implement 32-24 bpp conversion in shadow update

2015-07-26 Thread Matt Turner
On Wed, Jul 22, 2015 at 9:14 AM, Adam Jackson a...@redhat.com wrote:
 From: Dave Airlie airl...@redhat.com

 24bpp front buffers tend to be the least well tested path for client
 rendering.  On the qemu cirrus emulation, and on some Matrox G200 server
 chips, the hardware can't do 32bpp at all.  It's better to just allocate
 a 32bpp shadow and downconvert in the upload hook than expose a funky
 pixmap format to clients.

 [ajax: Ported from RHEL and separate modesetting driver, lifted kbpp
 into the drmmode struct, cleaned up commit message, fixed 16bpp]

 Reviewed-by: Adam Jackson a...@redhat.com
 Signed-off-by: Dave Airlied airl...@redhat.com
 ---
  hw/xfree86/drivers/modesetting/Makefile.am   |   2 +
  hw/xfree86/drivers/modesetting/driver.c  |  41 ---
  hw/xfree86/drivers/modesetting/drmmode_display.c |  24 ++--
  hw/xfree86/drivers/modesetting/drmmode_display.h |   2 +
  hw/xfree86/drivers/modesetting/sh3224.c  | 140 
 +++
  hw/xfree86/drivers/modesetting/sh3224.h  |   7 ++
  6 files changed, 193 insertions(+), 23 deletions(-)
  create mode 100644 hw/xfree86/drivers/modesetting/sh3224.c
  create mode 100644 hw/xfree86/drivers/modesetting/sh3224.h

 diff --git a/hw/xfree86/drivers/modesetting/Makefile.am 
 b/hw/xfree86/drivers/modesetting/Makefile.am
 index 82c4f2f..ca7e05a 100644
 --- a/hw/xfree86/drivers/modesetting/Makefile.am
 +++ b/hw/xfree86/drivers/modesetting/Makefile.am
 @@ -51,6 +51,8 @@ modesetting_drv_la_SOURCES = \
  dumb_bo.c \
  dumb_bo.h \
  present.c \
 +sh3224.c \
 +sh3224.h \
  vblank.c \
  $(NULL)

 diff --git a/hw/xfree86/drivers/modesetting/driver.c 
 b/hw/xfree86/drivers/modesetting/driver.c
 index 324b8bd..68a865f 100644
 --- a/hw/xfree86/drivers/modesetting/driver.c
 +++ b/hw/xfree86/drivers/modesetting/driver.c
 @@ -60,6 +60,7 @@
  #endif

  #include driver.h
 +#include sh3224.h

  static void AdjustFrame(ScrnInfoPtr pScrn, int x, int y);
  static Bool CloseScreen(ScreenPtr pScreen);
 @@ -770,10 +771,16 @@ PreInit(ScrnInfoPtr pScrn, int flags)
  }
  #endif
  drmmode_get_default_bpp(pScrn, ms-drmmode, defaultdepth, defaultbpp);
 -if (defaultdepth == 24  defaultbpp == 24)
 -bppflags = SupportConvert32to24 | Support24bppFb;
 -else
 -bppflags = PreferConvert24to32 | SupportConvert24to32 | 
 Support32bppFb;
 +if (defaultdepth == 24  defaultbpp == 24) {
 +   ms-drmmode.force_24_32 = TRUE;
 +   ms-drmmode.kbpp = 24;
 +   xf86DrvMsg(pScrn-scrnIndex, X_INFO,
 +  Using 24bpp hw front buffer with 32bpp shadow\n);
 +   defaultbpp = 32;
 +} else {
 +   ms-drmmode.kbpp = defaultbpp;
 +}
 +bppflags = PreferConvert24to32 | SupportConvert24to32 | Support32bppFb;

  if (!xf86SetDepthBpp
  (pScrn, defaultdepth, defaultdepth, defaultbpp, bppflags))
 @@ -827,18 +834,24 @@ PreInit(ScrnInfoPtr pScrn, int flags)
  } else {
  Bool prefer_shadow = TRUE;

 -ret = drmGetCap(ms-fd, DRM_CAP_DUMB_PREFER_SHADOW, value);
 -if (!ret) {
 -prefer_shadow = !!value;
 -}
 +   if (ms-drmmode.force_24_32) {
 +   prefer_shadow = TRUE;
 +   ms-drmmode.shadow_enable = TRUE;
 +   } else {
 +   ret = drmGetCap(ms-fd, DRM_CAP_DUMB_PREFER_SHADOW, value);
 +   if (!ret) {
 +   prefer_shadow = !!value;
 +   }

 -ms-drmmode.shadow_enable = xf86ReturnOptValBool(ms-Options,
 - OPTION_SHADOW_FB,
 - prefer_shadow);
 +   ms-drmmode.shadow_enable = xf86ReturnOptValBool(ms-Options,
 +OPTION_SHADOW_FB,
 +prefer_shadow);
 +   }

  xf86DrvMsg(pScrn-scrnIndex, X_INFO,
 ShadowFB: preferred %s, enabled %s\n,
 prefer_shadow ? YES : NO,
 +  ms-drmmode.force_24_32 ? FORCE :
 ms-drmmode.shadow_enable ? YES : NO);

  ms-drmmode.pageflip = FALSE;
 @@ -894,7 +907,7 @@ msShadowWindow(ScreenPtr screen, CARD32 row, CARD32 
 offset, int mode,
  modesettingPtr ms = modesettingPTR(pScrn);
  int stride;

 -stride = (pScrn-displayWidth * pScrn-bitsPerPixel) / 8;
 +stride = (pScrn-displayWidth * ms-drmmode.kbpp) / 8;
  *size = stride;

  return ((uint8_t *) ms-drmmode.front_bo.dumb-ptr + row * stride + 
 offset);
 @@ -915,6 +928,7 @@ CreateScreenResources(ScreenPtr pScreen)
  Bool ret;
  void *pixels = NULL;
  int err;
 +Bool use_ms_shadow = ms-drmmode.force_24_32  pScrn-bitsPerPixel == 
 32;

  pScreen-CreateScreenResources = ms-createScreenResources;
  ret = pScreen-CreateScreenResources(pScreen);
 @@ -946,7 +960,8 @@ CreateScreenResources(ScreenPtr pScreen)

[PATCH:x11proto] Incorrect guard block in HPkeysym.h

2015-07-26 Thread Alan Coopersmith
https://bugs.freedesktop.org/show_bug.cgi?id=91469

Signed-off-by: Alan Coopersmith alan.coopersm...@oracle.com
---
 HPkeysym.h |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/HPkeysym.h b/HPkeysym.h
index ed000b1..4a0655a 100644
--- a/HPkeysym.h
+++ b/HPkeysym.h
@@ -57,7 +57,7 @@ performance, or use of this material.
 
 #ifndef _HPKEYSYM_H
 
-#define _HPKEYSYM
+#define _HPKEYSYM_H
 
 #define hpXK_ClearLine 0x1000FF6F
 #define hpXK_InsertLine0x1000FF70
-- 
1.7.9.2

___
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

[libfontenc PATCH] make FontEncDirectory return a const string

2015-07-26 Thread Julien Cristau
Its comment already said This string is static and should not be
modified.

encparse.c: In function 'FontEncDirectory':
encparse.c:844:17: warning: assignment discards 'const' qualifier from pointer 
target type
 dir = FONT_ENCODINGS_DIRECTORY;
 ^

Signed-off-by: Julien Cristau jcris...@debian.org
---
 include/X11/fonts/fontenc.h | 2 +-
 src/encparse.c  | 8 
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/include/X11/fonts/fontenc.h b/include/X11/fonts/fontenc.h
index 709f97f..6c35c93 100644
--- a/include/X11/fonts/fontenc.h
+++ b/include/X11/fonts/fontenc.h
@@ -109,7 +109,7 @@ char *FontEncName(unsigned, FontMapPtr);
 
 /* Return a pointer to the name of the system encodings directory. */
 /* This string is static and should not be modified. */
-char *FontEncDirectory(void);
+const char *FontEncDirectory(void);
 
 /* Identify an encoding file.  If fileName doesn't exist, or is not an
encoding file, return NULL, otherwise returns a NULL-terminated
diff --git a/src/encparse.c b/src/encparse.c
index f47454a..548110e 100644
--- a/src/encparse.c
+++ b/src/encparse.c
@@ -827,13 +827,13 @@ parseEncodingFile(FontFilePtr f, int headerOnly)
 return NULL;
 }
 
-char *
+const char *
 FontEncDirectory(void)
 {
-static char *dir = NULL;
+static const char *dir = NULL;
 
 if (dir == NULL) {
-char *c = getenv(FONT_ENCODINGS_DIRECTORY);
+const char *c = getenv(FONT_ENCODINGS_DIRECTORY);
 
 if (c) {
 dir = strdup(c);
@@ -941,7 +941,7 @@ FontEncReallyLoad(const char *charset, const char 
*fontFileName)
 {
 FontEncPtr encoding;
 char dir[MAXFONTFILENAMELEN], dirname[MAXFONTFILENAMELEN];
-char *d;
+const char *d;
 
 if (fontFileName) {
 parseFontFileName(fontFileName, dirname, dir);
-- 
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: [libfontenc PATCH] make FontEncDirectory return a const string

2015-07-26 Thread Alan Coopersmith

While it's nominally exported, I see the only result in codesearch.debian.net
for calling it is from the call in FontEncReallyLoad, so it's safe to change.

Reviewed-by: Alan Coopersmith alan.coopersm...@oracle.com

-alan-

On 07/26/15 10:21 AM, Julien Cristau wrote:

Its comment already said This string is static and should not be
modified.

encparse.c: In function 'FontEncDirectory':
encparse.c:844:17: warning: assignment discards 'const' qualifier from pointer 
target type
  dir = FONT_ENCODINGS_DIRECTORY;
  ^

Signed-off-by: Julien Cristau jcris...@debian.org
---
  include/X11/fonts/fontenc.h | 2 +-
  src/encparse.c  | 8 
  2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/include/X11/fonts/fontenc.h b/include/X11/fonts/fontenc.h
index 709f97f..6c35c93 100644
--- a/include/X11/fonts/fontenc.h
+++ b/include/X11/fonts/fontenc.h
@@ -109,7 +109,7 @@ char *FontEncName(unsigned, FontMapPtr);

  /* Return a pointer to the name of the system encodings directory. */
  /* This string is static and should not be modified. */
-char *FontEncDirectory(void);
+const char *FontEncDirectory(void);

  /* Identify an encoding file.  If fileName doesn't exist, or is not an
 encoding file, return NULL, otherwise returns a NULL-terminated
diff --git a/src/encparse.c b/src/encparse.c
index f47454a..548110e 100644
--- a/src/encparse.c
+++ b/src/encparse.c
@@ -827,13 +827,13 @@ parseEncodingFile(FontFilePtr f, int headerOnly)
  return NULL;
  }

-char *
+const char *
  FontEncDirectory(void)
  {
-static char *dir = NULL;
+static const char *dir = NULL;

  if (dir == NULL) {
-char *c = getenv(FONT_ENCODINGS_DIRECTORY);
+const char *c = getenv(FONT_ENCODINGS_DIRECTORY);

  if (c) {
  dir = strdup(c);
@@ -941,7 +941,7 @@ FontEncReallyLoad(const char *charset, const char 
*fontFileName)
  {
  FontEncPtr encoding;
  char dir[MAXFONTFILENAMELEN], dirname[MAXFONTFILENAMELEN];
-char *d;
+const char *d;

  if (fontFileName) {
  parseFontFileName(fontFileName, dirname, dir);




--
-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

Re: [PATCH:xf86-input-mouse] Add some standard defines to pkg-config file.

2015-07-26 Thread Alan Coopersmith

I suppose that's reasonable since we're delivering xf86-mouse-properties.h
into includedir now.

Reviewed-by: Alan Coopersmith alan.coopersm...@oracle.com

-alan-

On 07/26/15 03:08 PM, Thomas Klausner wrote:

Not strictly needed in the xorg build, but helps the NetBSD reachover
build, and follows implicit conventions about pkg-config files more
closely.

See also http://gnats.netbsd.org/48991

Signed-off-by: Thomas Klausner w...@netbsd.org
---
  xorg-mouse.pc.in | 4 
  1 file changed, 4 insertions(+)

diff --git a/xorg-mouse.pc.in b/xorg-mouse.pc.in
index 2a77e7c..57df596 100644
--- a/xorg-mouse.pc.in
+++ b/xorg-mouse.pc.in
@@ -1,3 +1,7 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
  sdkdir=@sdkdir@

  Name: xorg-mouse




--
-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

FreeBSD/DragonFly patches for xf86-video-ati, xf86-input-mouse, and xf86-video-intel

2015-07-26 Thread Thomas Klausner
Hi!

David Shao reported some issues against pkgsrc, providing build/run
fixes for xorg software on DragonFly BSD and FreeBSD.

However, I'd like to avoid having pkgsrc-only patches. So I'm
wondering what your opinions are on getting (versions of) these
patches included.

He says that the patches are basically from FreeBSD ports.
Do we have a FreeBSD committer on this mailing list?

The patches are for xf86-video-ati (first one), xf86-input-mouse
(second), and xf86-video-intel (last).

Cheers,
 Thomas

(two FreeBSD X.org team members from https://wiki.freebsd.org/Graphics added to 
cc)

- Forwarded message from davs...@gmail.com -

Date: Mon, 20 Jul 2015 04:05:00 + (UTC)
From: davs...@gmail.com
To: pkg-mana...@netbsd.org, gnats-ad...@netbsd.org, pkgsrc-b...@netbsd.org
Cc: 
Subject: pkg/50067: x11/xf86-video-ati dports patch-src_radeon__kms.c for newer 
DragonFly and FreeBSD
Mail-Reply-To: davs...@gmail.com

Number: 50067
Category:   pkg
Synopsis:   x11/xf86-video-ati dports patch-src_radeon__kms.c for newer 
DragonFly and FreeBSD
Confidential:   no
Severity:   non-critical
Priority:   low
Responsible:pkg-manager
State:  open
Class:  sw-bug
Submitter-Id:   net
Arrival-Date:   Mon Jul 20 04:05:00 + 2015
Originator: David Shao
Release:pkgsrc current cvs
Organization:
Environment:
DragonFly  4.3-DEVELOPMENT DragonFly v4.2.2.63.ga2b9b7-DEVELOPMENT #1: Sun Jul 
19 19:22:57 PDT 2015 x@:/usr/obj/usr/src/sys/X86_64_GENERIC  x86_64
Description:
x11/xf86-video-ati can be patched using a patch from DragonFly dports so that 
KMS and other capabilities from newer DragonFly and FreeBSD Oses can be 
activated.  Unlike say NetBSD or OpenBSD, for DragonFly and FreeBSD the Radeon 
drm kernel modules are not necessarily loaded before Xorg is started using say 
startx.  

The following patch is from DragonFly dports master as of commit 
4f04bfe0ea83ce09 ..., 
file x11-drivers/xf86-video-ati/files/patch-src__radeon_kms.c:

It has been tested on DragonFly 4.3-DEVELOPMENT x86_64 and FreeBSD 10.1 release 
amd64, using openbox and a patched xf86-input-mouse.  It also at least compiled 
and built successfully on NetBSD 6.99.20 amd64 X11_type=modular, and should 
have no affect on it.  The result for DragonFly and FreeBSD is the desired 
activation, as can be seen from Xorg.0.log:

[61.049] (II) [KMS] Kernel modesetting enabled.
...
[63.244] (II) RADEON(0): KMS Color Tiling: enabled
[63.244] (II) RADEON(0): KMS Color Tiling 2D: enabled
[63.244] (II) RADEON(0): KMS Pageflipping: enabled
[63.244] (II) RADEON(0): SwapBuffers wait for vsync: enabled
[63.319] (II) RADEON(0): Output VGA-0 has no monitor section
[63.319] (II) RADEON(0): Output HDMI-0 has no monitor section
[63.326] (II) RADEON(0): Output DVI-0 has no monitor section
[63.400] (II) RADEON(0): EDID for output VGA-0
[63.400] (II) RADEON(0): Manufacturer: VSC  Model: d427  Serial#: 16843009
[63.400] (II) RADEON(0): Year: 2010  Week: 44
...
[63.425] (II) RADEON(0): [DRI2] Setup complete
[63.425] (II) RADEON(0): [DRI2]   DRI driver: r600
[63.425] (II) RADEON(0): [DRI2]   VDPAU driver: r600
[63.425] (II) RADEON(0): Front buffer size: 5120K
[63.425] (II) RADEON(0): VRAM usage limit set to 462384K
[63.440] (==) RADEON(0): Backing store enabled
[63.440] (II) RADEON(0): Direct rendering enabled
[63.440] (II) EXA(0): Driver allocated offscreen pixmaps
[63.440] (II) EXA(0): Driver registered support for the following 
operations:
[63.440] (II) Solid
[63.440] (II) Copy
[63.440] (II) Composite (RENDER acceleration)
[63.440] (II) UploadToScreen
[63.440] (II) DownloadFromScreen
[63.440] (II) RADEON(0): Acceleration enabled
[63.441] (==) RADEON(0): DPMS enabled
...
[63.444] (--) RandR disabled
[63.833] (II) AIGLX: enabled GLX_MESA_copy_sub_buffer
[63.833] (II) AIGLX: enabled GLX_ARB_create_context
[63.833] (II) AIGLX: enabled GLX_ARB_create_context_profile
[63.833] (II) AIGLX: enabled GLX_EXT_create_context_es2_profile
[63.833] (II) AIGLX: enabled GLX_INTEL_swap_event
[63.833] (II) AIGLX: enabled GLX_SGI_swap_control and GLX_MESA_swap_control
[63.833] (II) AIGLX: enabled GLX_EXT_framebuffer_sRGB
[63.833] (II) AIGLX: enabled GLX_ARB_fbconfig_float
[63.833] (II) AIGLX: GLX_EXT_texture_from_pixmap backed by buffer objects
[63.834] (II) AIGLX: Loaded and initialized r600






How-To-Repeat:

Fix:
The following is the patch:

$NetBSD$

--- src/radeon_kms.c.orig   2014-10-02 03:31:27.0 +
+++ src/radeon_kms.c
@@ -30,6 +30,12 @@
 
 #include errno.h
 #include sys/ioctl.h
+
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || 
defined(__DragonFly__)
+#include sys/param.h
+#include sys/linker.h
+#endif
+
 /* Driver data structures */
 #include radeon.h
 #include radeon_reg.h
@@ -280,7 +286,7 @@ static void
 

[PATCH] [RFC] modesetting: add zaphod support (v2)

2015-07-26 Thread Dave Airlie
From: Dave Airlie airl...@redhat.com

This adds zaphod and ZaphodHeads support
to the the in-server modesetting driver.

this is based on a request from Mario,
and on the current radeon driver.

v2: fixup vblank fd registring.

Signed-off-by: Dave Airlie airl...@redhat.com
---
 hw/xfree86/drivers/modesetting/driver.c  | 191 ++-
 hw/xfree86/drivers/modesetting/driver.h  |  32 ++--
 hw/xfree86/drivers/modesetting/drmmode_display.c |  47 +-
 hw/xfree86/drivers/modesetting/drmmode_display.h |   5 +
 hw/xfree86/drivers/modesetting/vblank.c  |  23 ++-
 5 files changed, 209 insertions(+), 89 deletions(-)

diff --git a/hw/xfree86/drivers/modesetting/driver.c 
b/hw/xfree86/drivers/modesetting/driver.c
index 324b8bd..5dcc6a0 100644
--- a/hw/xfree86/drivers/modesetting/driver.c
+++ b/hw/xfree86/drivers/modesetting/driver.c
@@ -118,24 +118,17 @@ static SymTabRec Chipsets[] = {
 {-1, NULL}
 };
 
-typedef enum {
-OPTION_SW_CURSOR,
-OPTION_DEVICE_PATH,
-OPTION_SHADOW_FB,
-OPTION_ACCEL_METHOD,
-OPTION_PAGEFLIP,
-} modesettingOpts;
-
 static const OptionInfoRec Options[] = {
 {OPTION_SW_CURSOR, SWcursor, OPTV_BOOLEAN, {0}, FALSE},
 {OPTION_DEVICE_PATH, kmsdev, OPTV_STRING, {0}, FALSE},
 {OPTION_SHADOW_FB, ShadowFB, OPTV_BOOLEAN, {0}, FALSE},
 {OPTION_ACCEL_METHOD, AccelMethod, OPTV_STRING, {0}, FALSE},
 {OPTION_PAGEFLIP, PageFlip, OPTV_BOOLEAN, {0}, FALSE},
+{OPTION_ZAPHOD_HEADS, ZaphodHeads, OPTV_STRING, {0}, FALSE},
 {-1, NULL, OPTV_NONE, {0}, FALSE}
 };
 
-int modesettingEntityIndex = -1;
+int ms_entity_index = -1;
 
 static MODULESETUPPROTO(Setup);
 
@@ -187,6 +180,15 @@ Identify(int flags)
   Chipsets);
 }
 
+modesettingEntPtr ms_ent_priv(ScrnInfoPtr scrn)
+{
+DevUnion *pPriv;
+modesettingPtr ms = modesettingPTR(scrn);
+pPriv = xf86GetEntityPrivate(ms-pEnt-index,
+ ms_entity_index);
+return pPriv-ptr;
+}
+
 static int
 open_hw(const char *dev)
 {
@@ -366,6 +368,7 @@ ms_platform_probe(DriverPtr driver,
   intptr_t match_data)
 {
 ScrnInfoPtr scrn = NULL;
+EntityInfoPtr pEnt;
 const char *path = xf86_platform_device_odev_attributes(dev)-path;
 int scr_flags = 0;
 
@@ -374,12 +377,39 @@ ms_platform_probe(DriverPtr driver,
 
 if (probe_hw(path, dev)) {
 scrn = xf86AllocateScreen(driver, scr_flags);
+if (xf86IsEntitySharable(entity_num))
+xf86SetEntityShared(entity_num);
 xf86AddEntityToScreen(scrn, entity_num);
 
 ms_setup_scrn_hooks(scrn);
 
 xf86DrvMsg(scrn-scrnIndex, X_INFO,
using drv %s\n, path ? path : default device);
+
+pEnt = xf86GetEntityInfo(entity_num);
+{
+DevUnion *pPriv;
+modesettingEntPtr pMSEnt;
+
+xf86SetEntitySharable(entity_num);
+
+if (ms_entity_index == -1)
+ms_entity_index = xf86AllocateEntityPrivateIndex();
+
+pPriv = xf86GetEntityPrivate(pEnt-index,
+ ms_entity_index);
+
+xf86SetEntityInstanceForScreen(scrn, pEnt-index, 
xf86GetNumEntityInstances(pEnt-index) - 1);
+
+if (!pPriv-ptr) {
+pPriv-ptr = xnfcalloc(sizeof(modesettingEntRec), 1);
+pMSEnt = pPriv-ptr;
+} else {
+pMSEnt = pPriv-ptr;
+}
+pMSEnt-platform_dev = dev;
+}
+
 }
 
 return scrn != NULL;
@@ -596,19 +626,25 @@ FreeRec(ScrnInfoPtr pScrn)
 pScrn-driverPrivate = NULL;
 
 if (ms-fd  0) {
+modesettingEntPtr ms_ent;
 int ret;
 
-if (ms-pEnt-location.type == BUS_PCI)
-ret = drmClose(ms-fd);
-else
+ms_ent = ms_ent_priv(pScrn);
+ms_ent-fd_ref--;
+if (!ms_ent-fd_ref) {
+if (ms-pEnt-location.type == BUS_PCI)
+ret = drmClose(ms-fd);
+else
 #ifdef XF86_PDEV_SERVER_FD
-if (!(ms-pEnt-location.type == BUS_PLATFORM 
-  (ms-pEnt-location.id.plat-flags  XF86_PDEV_SERVER_FD)))
+if (!(ms-pEnt-location.type == BUS_PLATFORM 
+  (ms-pEnt-location.id.plat-flags  
XF86_PDEV_SERVER_FD)))
 #endif
-ret = close(ms-fd);
-(void) ret;
+ret = close(ms-fd);
+(void) ret;
+ms_ent-fd = 0;
+}
 }
-free(ms-Options);
+free(ms-drmmode.Options);
 free(ms);
 
 }
@@ -617,7 +653,7 @@ static void
 try_enable_glamor(ScrnInfoPtr pScrn)
 {
 modesettingPtr ms = modesettingPTR(pScrn);
-const char *accel_method_str = xf86GetOptValString(ms-Options,
+const char *accel_method_str = xf86GetOptValString(ms-drmmode.Options,
OPTION_ACCEL_METHOD);
 Bool do_glamor = (!accel_method_str ||
   strcmp(accel_method_str, 

[PATCH libFS] include X11/Xmd.h in fs_transport

2015-07-26 Thread Julien Cristau
Xtrans defines BytesReadable_t as int or long depending on whether
LONG64 is defined.  So on a 64bit build it would be int when building
FSConnServ.c, but long for fs_transport.c.  To fix this inconsistency,
make fs_transport.c include X11/Xmd.h.

Debian bug#749120

Reported-by: Michael Tautschnig m...@debian.org
Signed-off-by: Julien Cristau jcris...@debian.org
---
 src/fs_transport.c | 1 +
 1 file changed, 1 insertion(+)

I'm not sure if this should be fixed in xtrans instead...

diff --git a/src/fs_transport.c b/src/fs_transport.c
index a924f91..347bd43 100644
--- a/src/fs_transport.c
+++ b/src/fs_transport.c
@@ -28,4 +28,5 @@
 #endif
 
 #include config.h /* Need to know which transport types to support */
+#include X11/Xmd.h
 #include X11/Xtrans/transport.c
-- 
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