Re: [Mesa-dev] [PATCH 4/7] dri2: Trust our own driver name lookup over the server's.

2014-01-29 Thread Stéphane Marchesin
On Tue, Jan 28, 2014 at 2:13 PM, Ian Romanick  wrote:

> On 01/28/2014 02:51 PM, Mark Mueller wrote:
> > This patch could cause the i965 driver to not load if Mesa was built on
> > a system without libudev devel present. For example on Fedora one should
> > install systemd-devel before configuring and building Mesa drivers
> > subsequent to this change.
>
> I don't think so.  loader_get_driver_for_fd should return NULL in that
> case, and the loader will fallback to the old behavior.
>

Except it doesn't; it goes and grabs the kernel module name. For example on
an i965 it will try to open the i915 driver, because that's the name of the
kernel module.

The erroneous assumption in this patch is that dri2 implies libudev is
present (this isn't checked by ./configure). Although that is true with
dri3, it's not the case with dri2. So in that respect the patch is
incorrect.

Stéphane


> > On Sun, Jan 26, 2014 at 4:02 PM, Keith Packard  > > wrote:
> >
> > Eric Anholt mailto:e...@anholt.net>> writes:
> >
> > > This allows Mesa to choose to rename driver .sos (or split
> drivers),
> > > without needing a flag day with the corresponding 2D driver.
> >
> > Reviewed-by: Keith Packard  > >
> >
> > --
> > keith.pack...@intel.com 
> >
> > ___
> > mesa-dev mailing list
> > mesa-dev@lists.freedesktop.org  mesa-dev@lists.freedesktop.org>
> > http://lists.freedesktop.org/mailman/listinfo/mesa-dev
> >
> >
> >
> >
> > ___
> > mesa-dev mailing list
> > mesa-dev@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/mesa-dev
> >
>
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 4/7] dri2: Trust our own driver name lookup over the server's.

2014-01-28 Thread Ian Romanick
On 01/28/2014 02:51 PM, Mark Mueller wrote:
> This patch could cause the i965 driver to not load if Mesa was built on
> a system without libudev devel present. For example on Fedora one should
> install systemd-devel before configuring and building Mesa drivers
> subsequent to this change.

I don't think so.  loader_get_driver_for_fd should return NULL in that
case, and the loader will fallback to the old behavior.

> On Sun, Jan 26, 2014 at 4:02 PM, Keith Packard  > wrote:
> 
> Eric Anholt mailto:e...@anholt.net>> writes:
> 
> > This allows Mesa to choose to rename driver .sos (or split drivers),
> > without needing a flag day with the corresponding 2D driver.
> 
> Reviewed-by: Keith Packard  >
> 
> --
> keith.pack...@intel.com 
> 
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org 
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
> 
> 
> 
> 
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
> 

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 4/7] dri2: Trust our own driver name lookup over the server's.

2014-01-28 Thread Mark Mueller
This patch could cause the i965 driver to not load if Mesa was built on a
system without libudev devel present. For example on Fedora one should
install systemd-devel before configuring and building Mesa drivers
subsequent to this change.



On Sun, Jan 26, 2014 at 4:02 PM, Keith Packard  wrote:

> Eric Anholt  writes:
>
> > This allows Mesa to choose to rename driver .sos (or split drivers),
> > without needing a flag day with the corresponding 2D driver.
>
> Reviewed-by: Keith Packard 
>
> --
> keith.pack...@intel.com
>
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 4/7] dri2: Trust our own driver name lookup over the server's.

2014-01-26 Thread Keith Packard
Eric Anholt  writes:

> This allows Mesa to choose to rename driver .sos (or split drivers),
> without needing a flag day with the corresponding 2D driver.

Reviewed-by: Keith Packard 

-- 
keith.pack...@intel.com


pgpcrXYj0vHR5.pgp
Description: PGP signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 4/7] dri2: Trust our own driver name lookup over the server's.

2014-01-23 Thread Eric Anholt
This allows Mesa to choose to rename driver .sos (or split drivers),
without needing a flag day with the corresponding 2D driver.
---
 src/glx/dri2_glx.c | 12 +++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c
index 4e2c16a..0a0dac9 100644
--- a/src/glx/dri2_glx.c
+++ b/src/glx/dri2_glx.c
@@ -51,6 +51,7 @@
 #include "dri2.h"
 #include "dri_common.h"
 #include "dri2_priv.h"
+#include "loader.h"
 
 /* From xmlpool/options.h, user exposed so should be stable */
 #define DRI_CONF_VBLANK_NEVER 0
@@ -1156,7 +1157,7 @@ dri2CreateScreen(int screen, struct glx_display * priv)
struct dri2_screen *psc;
__GLXDRIscreen *psp;
struct glx_config *configs = NULL, *visuals = NULL;
-   char *driverName, *deviceName, *tmp;
+   char *driverName = NULL, *loader_driverName, *deviceName, *tmp;
drm_magic_t magic;
int i;
 
@@ -1193,6 +1194,15 @@ dri2CreateScreen(int screen, struct glx_display * priv)
   goto handle_error;
}
 
+   /* If Mesa knows about the appropriate driver for this fd, then trust it.
+* Otherwise, default to the server's value.
+*/
+   loader_driverName = loader_get_driver_for_fd(psc->fd, 0);
+   if (loader_driverName) {
+  free(driverName);
+  driverName = loader_driverName;
+   }
+
psc->driver = driOpenDriver(driverName);
if (psc->driver == NULL) {
   ErrorMessageF("driver pointer missing\n");
-- 
1.8.5.3

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev