Skip to contentSkip to conversation

Add second DRI driver name (DRI2DriverVDPAU)

PATCH In review Ибрагимов Ринат 2 participants 9 messages Aug 16, 2013 – Aug 29, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add second DRI driver name (DRI2DriverVDPAU)

libvdpau uses second DRI driver name to determine which VDPAU driver to use. This patch will allow libvdpau choose libvdpau_i965.so on systems with Intel GPUs, libvdpau_nvidia.so on those with nVidia ones, and so on. I'm experimenting now with generic vdpau driver using OpenGL/VA-API, it would be convenient to have this driver selection working without manual driver selection.

---
 src/sna/sna_dri.c   |    5 +++--
 src/uxa/intel_dri.c |    5 +++--
 2 files changed, 6 insertions(+), 4 deletions(-)
src/sna/sna_dri.c +3 -2
index 1569251..0ba373d 100644
@@ -2299,7 +2299,7 @@ bool sna_dri_open(struct sna *sna, ScreenPtr screen)
 	DRI2InfoRec info;
 	int major = 1, minor = 0;
 #if DRI2INFOREC_VERSION >= 4
-	const char *driverNames[1];
+	const char *driverNames[2];
 #endif
 
 	DBG(("%s()\n", __FUNCTION__));
@@ -2336,9 +2336,10 @@ bool sna_dri_open(struct sna *sna, ScreenPtr screen)
 	info.ScheduleSwap = sna_dri_schedule_swap;
 	info.GetMSC = sna_dri_get_msc;
 	info.ScheduleWaitMSC = sna_dri_schedule_wait_msc;
-	info.numDrivers = 1;
+	info.numDrivers = 2;
 	info.driverNames = driverNames;
 	driverNames[0] = info.driverName;
+	driverNames[1] = info.driverName;
 #endif
 
 #if DRI2INFOREC_VERSION >= 6
src/uxa/intel_dri.c +3 -2
index 0370034..2d33380 100644
@@ -1553,7 +1553,7 @@ Bool I830DRI2ScreenInit(ScreenPtr screen)
 	int dri2_major = 1;
 	int dri2_minor = 0;
 #if DRI2INFOREC_VERSION >= 4
-	const char *driverNames[1];
+	const char *driverNames[2];
 #endif
 
 	if (intel->force_fallback) {
@@ -1620,9 +1620,10 @@ Bool I830DRI2ScreenInit(ScreenPtr screen)
 	info.ScheduleSwap = I830DRI2ScheduleSwap;
 	info.GetMSC = I830DRI2GetMSC;
 	info.ScheduleWaitMSC = I830DRI2ScheduleWaitMSC;
-	info.numDrivers = 1;
+	info.numDrivers = 2;
 	info.driverNames = driverNames;
 	driverNames[0] = info.driverName;
+	driverNames[1] = info.driverName;
 #endif
 
 	return DRI2ScreenInit(screen, &info);
Signature · 1 line
1.7.10.4
#1 lore raw

Ping.

Пятница, 16 августа 2013, 14:31 +04:00 от Ибрагимов Ринат<[email protected]>:

Quoted 71 lines

libvdpau uses second DRI driver name to determine which VDPAU driver to use. This patch will allow libvdpau choose libvdpau_i965.so on systems with Intel GPUs, libvdpau_nvidia.so on those with nVidia ones, and so on. I'm experimenting now with generic vdpau driver using OpenGL/VA-API, it would be convenient to have this driver selection working without manual driver selection.

---
 src/sna/sna_dri.c   |    5 +++--
 src/uxa/intel_dri.c |    5 +++--
 2 files changed, 6 insertions(+), 4 deletions(-)
src/sna/sna_dri.c +3 -2
index 1569251..0ba373d 100644
@@ -2299,7 +2299,7 @@ bool sna_dri_open(struct sna *sna, ScreenPtr screen)
 	DRI2InfoRec info;
 	int major = 1, minor = 0;
 #if DRI2INFOREC_VERSION >= 4
-	const char *driverNames[1];
+	const char *driverNames[2];
 #endif
 
 	DBG(("%s()\n", __FUNCTION__));
@@ -2336,9 +2336,10 @@ bool sna_dri_open(struct sna *sna, ScreenPtr screen)
 	info.ScheduleSwap = sna_dri_schedule_swap;
 	info.GetMSC = sna_dri_get_msc;
 	info.ScheduleWaitMSC = sna_dri_schedule_wait_msc;
-	info.numDrivers = 1;
+	info.numDrivers = 2;
 	info.driverNames = driverNames;
 	driverNames[0] = info.driverName;
+	driverNames[1] = info.driverName;
 #endif
 
 #if DRI2INFOREC_VERSION >= 6
src/uxa/intel_dri.c +3 -2
index 0370034..2d33380 100644
@@ -1553,7 +1553,7 @@ Bool I830DRI2ScreenInit(ScreenPtr screen)
 	int dri2_major = 1;
 	int dri2_minor = 0;
 #if DRI2INFOREC_VERSION >= 4
-	const char *driverNames[1];
+	const char *driverNames[2];
 #endif
 
 	if (intel->force_fallback) {
@@ -1620,9 +1620,10 @@ Bool I830DRI2ScreenInit(ScreenPtr screen)
 	info.ScheduleSwap = I830DRI2ScheduleSwap;
 	info.GetMSC = I830DRI2GetMSC;
 	info.ScheduleWaitMSC = I830DRI2ScheduleWaitMSC;
-	info.numDrivers = 1;
+	info.numDrivers = 2;
 	info.driverNames = driverNames;
 	driverNames[0] = info.driverName;
+	driverNames[1] = info.driverName;
 #endif
 
 	return DRI2ScreenInit(screen, &info);
Signature · 6 lines
1.7.10.4

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

---
Rinat
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

#2 lore raw
In reply to Ибрагимов Ринат

Ping.

Пятница, 16 августа 2013, 14:31 +04:00 от Ибрагимов Ринат<[email protected]>:

Quoted 71 lines

libvdpau uses second DRI driver name to determine which VDPAU driver to use. This patch will allow libvdpau choose libvdpau_i965.so on systems with Intel GPUs, libvdpau_nvidia.so on those with nVidia ones, and so on. I'm experimenting now with generic vdpau driver using OpenGL/VA-API, it would be convenient to have this driver selection working without manual driver selection.

---
 src/sna/sna_dri.c   |    5 +++--
 src/uxa/intel_dri.c |    5 +++--
 2 files changed, 6 insertions(+), 4 deletions(-)
src/sna/sna_dri.c +3 -2
index 1569251..0ba373d 100644
@@ -2299,7 +2299,7 @@ bool sna_dri_open(struct sna *sna, ScreenPtr screen)
 	DRI2InfoRec info;
 	int major = 1, minor = 0;
 #if DRI2INFOREC_VERSION >= 4
-	const char *driverNames[1];
+	const char *driverNames[2];
 #endif
 
 	DBG(("%s()\n", __FUNCTION__));
@@ -2336,9 +2336,10 @@ bool sna_dri_open(struct sna *sna, ScreenPtr screen)
 	info.ScheduleSwap = sna_dri_schedule_swap;
 	info.GetMSC = sna_dri_get_msc;
 	info.ScheduleWaitMSC = sna_dri_schedule_wait_msc;
-	info.numDrivers = 1;
+	info.numDrivers = 2;
 	info.driverNames = driverNames;
 	driverNames[0] = info.driverName;
+	driverNames[1] = info.driverName;
 #endif
 
 #if DRI2INFOREC_VERSION >= 6
src/uxa/intel_dri.c +3 -2
index 0370034..2d33380 100644
@@ -1553,7 +1553,7 @@ Bool I830DRI2ScreenInit(ScreenPtr screen)
 	int dri2_major = 1;
 	int dri2_minor = 0;
 #if DRI2INFOREC_VERSION >= 4
-	const char *driverNames[1];
+	const char *driverNames[2];
 #endif
 
 	if (intel->force_fallback) {
@@ -1620,9 +1620,10 @@ Bool I830DRI2ScreenInit(ScreenPtr screen)
 	info.ScheduleSwap = I830DRI2ScheduleSwap;
 	info.GetMSC = I830DRI2GetMSC;
 	info.ScheduleWaitMSC = I830DRI2ScheduleWaitMSC;
-	info.numDrivers = 1;
+	info.numDrivers = 2;
 	info.driverNames = driverNames;
 	driverNames[0] = info.driverName;
+	driverNames[1] = info.driverName;
 #endif
 
 	return DRI2ScreenInit(screen, &info);
Signature · 6 lines
1.7.10.4

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

---
Rinat
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

#3 lore raw
In reply to Ибрагимов Ринат
Quoted 6 lines · Ибрагимов Ринат

libvdpau uses second DRI driver name to determine which VDPAU driver to use. This patch will allow libvdpau choose libvdpau_i965.so on systems with Intel GPUs, libvdpau_nvidia.so on those with nVidia ones, and so on. I'm experimenting now with generic vdpau driver using OpenGL/VA-API, it would be convenient to have this driver selection working without manual driver selection.

If it's a generic driver, why would it need a "i965" string passed over the DRI2 protocol to find it?

One of the things I'm planning on doing is removing use of the protocol-provided DRI2 driver name from Mesa -- Mesa knows what drivers it has built, and it knows how to detect those devices (in the EGL code), so why would we pay attention to what the X Server thinks our driver's name is? Seems like vdpau could probably do the same.

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

#4 lore raw

Понедельник, 26 августа 2013, 13:40 -07:00 от Eric Anholt <[email protected]>:

Quoted 11 lines
Quoted 6 lines · Ибрагимов Ринат

libvdpau uses second DRI driver name to determine which VDPAU driver to use. This patch will allow libvdpau choose libvdpau_i965.so on systems with Intel GPUs, libvdpau_nvidia.so on those with nVidia ones, and so on. I'm experimenting now with generic vdpau driver using OpenGL/VA-API, it would be convenient to have this driver selection working without manual driver selection.

If it's a generic driver, why would it need a "i965" string passed over the DRI2 protocol to find it?

It doesn't actually. It's just to simplify distribution package management. If one names driver libvdpau_nvidia.so.1, it will break VDPAU on nVidia equipped machines. With this patch one can name it libvdpau_i965.so.1 and driver will be loaded on intel equipped machines only.

Quoted 7 lines

One of the things I'm planning on doing is removing use of the protocol-provided DRI2 driver name from Mesa -- Mesa knows what drivers it has built, and it knows how to detect those devices (in the EGL code), so why would we pay attention to what the X Server thinks our driver's name is? Seems like vdpau could probably do the same.

VDPAU uses entry point library (libvdpau) which loads backend drivers. libvdpau uses second DRI2 driver name amongst other methods to determine which driver to load. It can not rely on Mesa's internal knowledge, because it must work with proprietary nVidia driver too.

---
Rinat
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

#5 lore raw
Quoted 27 lines · Rinat Ibragimov

Понедельник, 26 августа 2013, 13:40 -07:00 от Eric Anholt <[email protected]>:

Quoted 11 lines
Quoted 6 lines · Ибрагимов Ринат

libvdpau uses second DRI driver name to determine which VDPAU driver to use. This patch will allow libvdpau choose libvdpau_i965.so on systems with Intel GPUs, libvdpau_nvidia.so on those with nVidia ones, and so on. I'm experimenting now with generic vdpau driver using OpenGL/VA-API, it would be convenient to have this driver selection working without manual driver selection.

If it's a generic driver, why would it need a "i965" string passed over the DRI2 protocol to find it?

It doesn't actually. It's just to simplify distribution package management. If one names driver libvdpau_nvidia.so.1, it will break VDPAU on nVidia equipped machines. With this patch one can name it libvdpau_i965.so.1 and driver will be loaded on intel equipped machines only.

Quoted 7 lines

One of the things I'm planning on doing is removing use of the protocol-provided DRI2 driver name from Mesa -- Mesa knows what drivers it has built, and it knows how to detect those devices (in the EGL code), so why would we pay attention to what the X Server thinks our driver's name is? Seems like vdpau could probably do the same.

Quoted 4 lines

VDPAU uses entry point library (libvdpau) which loads backend drivers. libvdpau uses second DRI2 driver name amongst other methods to determine which driver to load. It can not rely on Mesa's internal knowledge, because it must work with proprietary nVidia driver too.

Right, I meant "couldn't libvdpau have a method to determine which driver to load based on looking at your hardware, like how Mesa's EGL does?", since only libvdpau is likely to know how pieces of hardware map to driver binaries.

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

#6 lore raw

Понедельник, 26 августа 2013, 16:22 -07:00 от Eric Anholt <[email protected]>:

Quoted 34 lines
Quoted 27 lines · Rinat Ibragimov

Понедельник, 26 августа 2013, 13:40 -07:00 от Eric Anholt <[email protected]>:

Quoted 11 lines
Quoted 6 lines · Ибрагимов Ринат

libvdpau uses second DRI driver name to determine which VDPAU driver to use. This patch will allow libvdpau choose libvdpau_i965.so on systems with Intel GPUs, libvdpau_nvidia.so on those with nVidia ones, and so on. I'm experimenting now with generic vdpau driver using OpenGL/VA-API, it would be convenient to have this driver selection working without manual driver selection.

If it's a generic driver, why would it need a "i965" string passed over the DRI2 protocol to find it?

It doesn't actually. It's just to simplify distribution package management. If one names driver libvdpau_nvidia.so.1, it will break VDPAU on nVidia equipped machines. With this patch one can name it libvdpau_i965.so.1 and driver will be loaded on intel equipped machines only.

Quoted 7 lines

One of the things I'm planning on doing is removing use of the protocol-provided DRI2 driver name from Mesa -- Mesa knows what drivers it has built, and it knows how to detect those devices (in the EGL code), so why would we pay attention to what the X Server thinks our driver's name is? Seems like vdpau could probably do the same.

Quoted 4 lines

VDPAU uses entry point library (libvdpau) which loads backend drivers. libvdpau uses second DRI2 driver name amongst other methods to determine which driver to load. It can not rely on Mesa's internal knowledge, because it must work with proprietary nVidia driver too.

Quoted 5 lines

Right, I meant "couldn't libvdpau have a method to determine which driver to load based on looking at your hardware, like how Mesa's EGL does?", since only libvdpau is likely to know how pieces of hardware map to driver binaries.

VDPAU drivers have separate code from libvdpau, while Mesa have drivers inside it (if I get it right). I can't figure out how libvdpau beeing separate can determine mapping between hardware and driver to load. The only way is to ask[1] DRI2.

[1] http://cgit.freedesktop.org/~aplattner/libvdpau/tree/src/vdpau_wrapper.c#n104
---
Rinat
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

#7 lore raw
Quoted 41 lines · Rinat Ibragimov

Понедельник, 26 августа 2013, 16:22 -07:00 от Eric Anholt <[email protected]>:

Quoted 34 lines
Quoted 27 lines · Rinat Ibragimov

Понедельник, 26 августа 2013, 13:40 -07:00 от Eric Anholt <[email protected]>:

Quoted 11 lines
Quoted 6 lines · Ибрагимов Ринат

libvdpau uses second DRI driver name to determine which VDPAU driver to use. This patch will allow libvdpau choose libvdpau_i965.so on systems with Intel GPUs, libvdpau_nvidia.so on those with nVidia ones, and so on. I'm experimenting now with generic vdpau driver using OpenGL/VA-API, it would be convenient to have this driver selection working without manual driver selection.

If it's a generic driver, why would it need a "i965" string passed over the DRI2 protocol to find it?

It doesn't actually. It's just to simplify distribution package management. If one names driver libvdpau_nvidia.so.1, it will break VDPAU on nVidia equipped machines. With this patch one can name it libvdpau_i965.so.1 and driver will be loaded on intel equipped machines only.

Quoted 7 lines

One of the things I'm planning on doing is removing use of the protocol-provided DRI2 driver name from Mesa -- Mesa knows what drivers it has built, and it knows how to detect those devices (in the EGL code), so why would we pay attention to what the X Server thinks our driver's name is? Seems like vdpau could probably do the same.

Quoted 4 lines

VDPAU uses entry point library (libvdpau) which loads backend drivers. libvdpau uses second DRI2 driver name amongst other methods to determine which driver to load. It can not rely on Mesa's internal knowledge, because it must work with proprietary nVidia driver too.

Quoted 5 lines

Right, I meant "couldn't libvdpau have a method to determine which driver to load based on looking at your hardware, like how Mesa's EGL does?", since only libvdpau is likely to know how pieces of hardware map to driver binaries.

Quoted 4 lines

VDPAU drivers have separate code from libvdpau, while Mesa have drivers inside it (if I get it right). I can't figure out how libvdpau beeing separate can determine mapping between hardware and driver to load. The only way is to ask[1] DRI2.

Yet the Xorg 2D driver is even less related to the set of vdpau drivers available than the vdpau driver loader (which could do things like look at a symbol in the driver to find a probing mechanism, like the X Server does to X drivers, or read some config directory containing mappings installed by the external drivers).

The reason I'm making a point of this is that DRI3 is dropping the driver name strings from the protocol.

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

#8 lore raw

Среда, 28 августа 2013, 16:26 -07:00 от Eric Anholt <[email protected]>:

Quoted 48 lines
Quoted 41 lines · Rinat Ibragimov

Понедельник, 26 августа 2013, 16:22 -07:00 от Eric Anholt <[email protected]>:

Quoted 34 lines
Quoted 27 lines · Rinat Ibragimov

Понедельник, 26 августа 2013, 13:40 -07:00 от Eric Anholt <[email protected]>:

Quoted 11 lines
Quoted 6 lines · Ибрагимов Ринат

libvdpau uses second DRI driver name to determine which VDPAU driver to use. This patch will allow libvdpau choose libvdpau_i965.so on systems with Intel GPUs, libvdpau_nvidia.so on those with nVidia ones, and so on. I'm experimenting now with generic vdpau driver using OpenGL/VA-API, it would be convenient to have this driver selection working without manual driver selection.

If it's a generic driver, why would it need a "i965" string passed over the DRI2 protocol to find it?

It doesn't actually. It's just to simplify distribution package management. If one names driver libvdpau_nvidia.so.1, it will break VDPAU on nVidia equipped machines. With this patch one can name it libvdpau_i965.so.1 and driver will be loaded on intel equipped machines only.

Quoted 7 lines

One of the things I'm planning on doing is removing use of the protocol-provided DRI2 driver name from Mesa -- Mesa knows what drivers it has built, and it knows how to detect those devices (in the EGL code), so why would we pay attention to what the X Server thinks our driver's name is? Seems like vdpau could probably do the same.

Quoted 4 lines

VDPAU uses entry point library (libvdpau) which loads backend drivers. libvdpau uses second DRI2 driver name amongst other methods to determine which driver to load. It can not rely on Mesa's internal knowledge, because it must work with proprietary nVidia driver too.

Quoted 5 lines

Right, I meant "couldn't libvdpau have a method to determine which driver to load based on looking at your hardware, like how Mesa's EGL does?", since only libvdpau is likely to know how pieces of hardware map to driver binaries.

Quoted 4 lines

VDPAU drivers have separate code from libvdpau, while Mesa have drivers inside it (if I get it right). I can't figure out how libvdpau beeing separate can determine mapping between hardware and driver to load. The only way is to ask[1] DRI2.

Quoted 9 lines

Yet the Xorg 2D driver is even less related to the set of vdpau drivers available than the vdpau driver loader (which could do things like look at a symbol in the driver to find a probing mechanism, like the X Server does to X drivers, or read some config directory containing mappings installed by the external drivers).

The reason I'm making a point of this is that DRI3 is dropping the driver name strings from the protocol.

Now I see, it should work (with probing mechanism). But there are too many pieces should be touched to get this working, although it looks like the right thing to do.

On the other hand, all I'm trying to do is to find minimal change to make driver autoloading work.

---
Rinat
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx