pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: pkg/51687: x11/xf86-video-intel fix build post xserver 1.19



The following reply was made to PR pkg/51687; it has been noted by GNATS.

From: David Shao <davshao%gmail.com@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: pkg/51687: x11/xf86-video-intel fix build post xserver 1.19
Date: Mon, 5 Dec 2016 22:12:25 -0800

 With the following further changes to x11/xf86-video-intel's
 src/sna/sna_driver.c, I am able to run xfce4 on FreeBSD 11 release on
 the Intel i3-3225 CPU, Asus P8H77-V motherboard machine.
 
 That means there are at least two OSes, DragonFly 4.7-DEVELOPMENT and
 FreeBSD 11 release, for which xf86-video-intel can be patched to work,
 here enabling SNA acceleration and with --enable-debug set, so that
 the runtime assertions can be checked.  The successful debugging of
 what initially prevented xfce4 / xorg from starting on FreeBSD 11
 release is why I have argued that enabling debug should be an option
 provided to the user for xorg ports.
 
 The important change is from 2016-09-19
 "sna: Update sanity check for next stage of Xorg ABI"
 
 https://cgit.freedesktop.org/xorg/driver/xf86-video-intel/commit/?id=b45dbdbd446108745b39b305303b457f5e876989
 
 An assertion needs to be changed to allow not just a NULL value but a
 certain screen value as well.  This change needs to be translated back
 using 2015-01-13
 "sna: Wrap direct access to ScrnInfoPtr->pScreen"
 
 https://cgit.freedesktop.org/xorg/driver/xf86-video-intel/commit/?id=b7feeca0730bf55c23e5bc5af4cae9b8a73bba0e
 
 The new part of the patch therefore reads:
 
 -    assert(scrn->pScreen == NULL); /* set afterwards */
 +    assert(scrn->pScreen == NULL || /* set afterwards */
 +           scrn->pScreen == screen);
 
 Another smaller problem fixed is I put an #if test in the wrong place.
 
 The following is the new full patch for sna_driver.c:
 
 $NetBSD$
 
 --- src/sna/sna_driver.c.orig    2014-12-11 13:52:11.000000000 +0000
 +++ src/sna/sna_driver.c
 @@ -721,6 +721,7 @@ cleanup:
      return FALSE;
  }
 
 +#if !HAVE_NOTIFY_FD
  static bool has_shadow(struct sna *sna)
  {
      if (!sna->mode.shadow_damage)
 @@ -778,6 +779,31 @@ sna_wakeup_handler(WAKEUPHANDLER_ARGS_DE
          FD_CLR(sna->kgem.fd, (fd_set*)read_mask);
      }
  }
 +#else
 +static void
 +sna_block_handler(void *data, void *_timeout)
 +{
 +    struct sna *sna = data;
 +    int *timeout = _timeout;
 +    struct timeval tv, *tvp;
 +
 +    DBG(("%s (timeout=%d)\n", __FUNCTION__, *timeout));
 +    if (*timeout == 0)
 +        return;
 +
 +    if (*timeout < 0) {
 +        tvp = NULL;
 +    } else {
 +        tv.tv_sec = *timeout / 1000;
 +        tv.tv_usec = (*timeout % 1000) * 1000;
 +        tvp = &tv;
 +    }
 +
 +    sna_accel_block_handler(sna, &tvp);
 +    if (tvp)
 +        *timeout = tvp->tv_sec * 1000 + tvp->tv_usec / 1000;
 +}
 +#endif
 
  #if HAVE_UDEV
  static void
 @@ -948,6 +974,12 @@ static Bool sna_early_close_screen(CLOSE
 
      /* XXX Note that we will leak kernel resources if !vtSema */
 
 +#if HAVE_NOTIFY_FD
 +    RemoveBlockAndWakeupHandlers(sna_block_handler,
 +                     (ServerWakeupHandlerProcPtr)NoopDDA,
 +                     sna);
 +#endif
 +
      sna_uevent_fini(sna);
      sna_mode_close(sna);
 
 @@ -1098,7 +1130,8 @@ sna_screen_init(SCREEN_INIT_ARGS_DECL)
      DBG(("%s\n", __FUNCTION__));
 
      assert(sna->scrn == scrn);
 -    assert(scrn->pScreen == NULL); /* set afterwards */
 +    assert(scrn->pScreen == NULL || /* set afterwards */
 +           scrn->pScreen == screen);
 
      assert(sna->freed_pixmap == NULL);
 
 @@ -1166,11 +1199,17 @@ sna_screen_init(SCREEN_INIT_ARGS_DECL)
       * later memory should be bound when allocating, e.g rotate_mem */
      scrn->vtSema = TRUE;
 
 +#if !HAVE_NOTIFY_FD
      sna->BlockHandler = screen->BlockHandler;
      screen->BlockHandler = sna_block_handler;
 
      sna->WakeupHandler = screen->WakeupHandler;
      screen->WakeupHandler = sna_wakeup_handler;
 +#else
 +    RegisterBlockAndWakeupHandlers(sna_block_handler,
 +                       (ServerWakeupHandlerProcPtr)NoopDDA,
 +                       sna);
 +#endif
 
      screen->SaveScreen = sna_save_screen;
      screen->CreateScreenResources = sna_create_screen_resources;
 


Home | Main Index | Thread Index | Old Index