[PATCH xserver 2/3] modesetting: Remove #ifdefs XF86_PDEV_SERVER_FD

Thomas Klausner wiz at NetBSD.org
Wed Mar 14 20:01:08 UTC 2018


I see a build failure in xorg-server-1.19.99.901 on NetBSD.

  GEN      modesetting.4
driver.c: In function 'probe_hw':
driver.c:247:38: error: dereferencing pointer to incomplete type 'struct xf86_platform_device'
     if (platform_dev && (platform_dev->flags & XF86_PDEV_SERVER_FD)) {
                                      ^~
driver.c:247:48: error: 'XF86_PDEV_SERVER_FD' undeclared (first use in this function)
     if (platform_dev && (platform_dev->flags & XF86_PDEV_SERVER_FD)) {
                                                ^~~~~~~~~~~~~~~~~~~
driver.c:247:48: note: each undeclared identifier is reported only once for each function it appears in
driver.c:248:14: error: implicit declaration of function 'xf86_platform_device_odev_attributes' [-Werror=implicit-function-declaration]
         fd = xf86_platform_device_odev_attributes(platform_dev)->fd;
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
driver.c:248:9: warning: nested extern declaration of 'xf86_platform_device_odev_attributes' [-Wnested-externs]
         fd = xf86_platform_device_odev_attributes(platform_dev)->fd;
         ^~
driver.c:248:64: error: invalid type argument of '->' (have 'int')
         fd = xf86_platform_device_odev_attributes(platform_dev)->fd;
                                                                ^~
driver.c: In function 'FreeRec':
driver.c:714:60: error: 'XF86_PDEV_SERVER_FD' undeclared (first use in this function)
                       (ms->pEnt->location.id.plat->flags & XF86_PDEV_SERVER_FD)))
                                                            ^~~~~~~~~~~~~~~~~~~
driver.c: In function 'msEnableSharedPixmapFlipping':
driver.c:1171:19: warning: unused variable 'pEnt' [-Wunused-variable]
     EntityInfoPtr pEnt = ms->pEnt;
                   ^~~~
driver.c: In function 'SetMaster':
driver.c:1495:46: error: 'XF86_PDEV_SERVER_FD' undeclared (first use in this function)
         (ms->pEnt->location.id.plat->flags & XF86_PDEV_SERVER_FD))
                                              ^~~~~~~~~~~~~~~~~~~
driver.c: In function 'LeaveVT':
driver.c:1746:46: error: 'XF86_PDEV_SERVER_FD' undeclared (first use in this function)
         (ms->pEnt->location.id.plat->flags & XF86_PDEV_SERVER_FD))
                                              ^~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors

XF86_PDEV_SERVER_FD is defined in xf86platformBus.h, but that file is
only included in hw/xfree86/drivers/modesetting/driver.c in an #ifdef:

#ifdef XSERVER_PLATFORM_BUS
#include "xf86platformBus.h"
#endif

but no similar define protects the macro's use.
 Thomas

On Fri, Oct 20, 2017 at 10:05:34AM +0200, Daniel Martin wrote:
> XF86_PDEV_SERVER_FD is defined since:
> 
>     commit 5fb641a29bfb4a33da964e1e9af523f3472015c6
>     Author: Hans de Goede <hdegoede at redhat.com>
>     Date:   Mon Jan 13 12:03:46 2014 +0100
> 
>         hotplug: Extend OdevAttributes for server-managed fd support
> 
> ifdef'ing for it is a leftover from the external xf86-video-modesetting.
> 
> Signed-off-by: Daniel Martin <consume.noise at gmail.com>
> ---
>  hw/xfree86/drivers/modesetting/driver.c | 10 ----------
>  1 file changed, 10 deletions(-)
> 
> diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c
> index 91d850427..380dbbe17 100644
> --- a/hw/xfree86/drivers/modesetting/driver.c
> +++ b/hw/xfree86/drivers/modesetting/driver.c
> @@ -244,14 +244,12 @@ probe_hw(const char *dev, struct xf86_platform_device *platform_dev)
>  {
>      int fd;
>  
> -#ifdef XF86_PDEV_SERVER_FD
>      if (platform_dev && (platform_dev->flags & XF86_PDEV_SERVER_FD)) {
>          fd = xf86_platform_device_odev_attributes(platform_dev)->fd;
>          if (fd == -1)
>              return FALSE;
>          return check_outputs(fd, NULL);
>      }
> -#endif
>  
>      fd = open_hw(dev);
>      if (fd != -1) {
> @@ -712,10 +710,8 @@ FreeRec(ScrnInfoPtr pScrn)
>              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)))
> -#endif
>                      ret = close(ms->fd);
>              (void) ret;
>              ms_ent->fd = 0;
> @@ -828,13 +824,11 @@ ms_get_drm_master_fd(ScrnInfoPtr pScrn)
>  
>  #ifdef XSERVER_PLATFORM_BUS
>      if (pEnt->location.type == BUS_PLATFORM) {
> -#ifdef XF86_PDEV_SERVER_FD
>          if (pEnt->location.id.plat->flags & XF86_PDEV_SERVER_FD)
>              ms->fd =
>                  xf86_platform_device_odev_attributes(pEnt->location.id.plat)->
>                  fd;
>          else
> -#endif
>          {
>              char *path =
>                  xf86_platform_device_odev_attributes(pEnt->location.id.plat)->
> @@ -1496,11 +1490,9 @@ SetMaster(ScrnInfoPtr pScrn)
>      modesettingPtr ms = modesettingPTR(pScrn);
>      int ret;
>  
> -#ifdef XF86_PDEV_SERVER_FD
>      if (ms->pEnt->location.type == BUS_PLATFORM &&
>          (ms->pEnt->location.id.plat->flags & XF86_PDEV_SERVER_FD))
>          return TRUE;
> -#endif
>  
>      ret = drmSetMaster(ms->fd);
>      if (ret)
> @@ -1749,11 +1741,9 @@ LeaveVT(ScrnInfoPtr pScrn)
>  
>      pScrn->vtSema = FALSE;
>  
> -#ifdef XF86_PDEV_SERVER_FD
>      if (ms->pEnt->location.type == BUS_PLATFORM &&
>          (ms->pEnt->location.id.plat->flags & XF86_PDEV_SERVER_FD))
>          return;
> -#endif
>  
>      drmDropMaster(ms->fd);
>  }
> -- 
> 2.13.6
> 
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: https://lists.x.org/mailman/listinfo/xorg-devel


More information about the xorg-devel mailing list