<div dir="ltr"><div>BTW, swrast doesn't have to exist on the system. It's not uncommon for me to have no swrast on my development system.<br></div><div><br></div><div>Marek<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, May 1, 2019 at 4:30 AM Mathias Fröhlich <<a href="mailto:Mathias.Froehlich@gmx.net">Mathias.Froehlich@gmx.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Marek, Emil,<br>
<br>
On Tuesday, 30 April 2019 15:36:08 CEST Emil Velikov wrote:<br>
> On Mon, 29 Apr 2019 at 22:50, Marek Olšák <<a href="mailto:maraeo@gmail.com" target="_blank">maraeo@gmail.com</a>> wrote:<br>
> ><br>
> > On Mon, Apr 29, 2019 at 4:00 AM Pekka Paalanen <<a href="mailto:ppaalanen@gmail.com" target="_blank">ppaalanen@gmail.com</a>> wrote:<br>
> >><br>
> >> On Sat, 27 Apr 2019 09:38:27 -0400<br>
> >> Marek Olšák <<a href="mailto:maraeo@gmail.com" target="_blank">maraeo@gmail.com</a>> wrote:<br>
> >><br>
> >> > Those are all valid reasons, but I don't wanna expose swrast for AMD's<br>
> >> > customers.<br>
> >><br>
> >> Hi Marek,<br>
> >><br>
> >> is you objection that you will never want to see any software renderer<br>
> >> in the list, or that you don't want to see a software renderer only as<br>
> >> long as it doesn't actually work?<br>
> >><br>
> >> Why do you not "wanna expose swrast for AMD's customers"?<br>
> >><br>
> >> Are you talking about swrast specifically or all the software renderers<br>
> >> in Mesa?<br>
> >><br>
> >> I'm not an AMD customer if you mean someone paying for support rather<br>
> >> than just buying their hardware, so I cannot speak for them. However, I<br>
> >> would be very happy to have a software renderer available to be picked<br>
> >> the same way as any other hardware renderer, so that I can use it in<br>
> >> graphical test suites (a point from Anholt) testing also the EGL glue<br>
> >> in addition to the pixels produced.<br>
> >><br>
> >> The thing will be run on boxes with AMD GPUs, and in those cases there<br>
> >> must be a way to *not* use the AMD GPU, and use the software renderer<br>
> >> instead when wanted. Not by environment variables or anything hacky<br>
> >> like that, but by deliberately choosing the software renderer in the<br>
> >> program. It will need an EGLSurface too.<br>
> >><br>
> >> How would this be made to work in the future?<br>
> ><br>
> ><br>
> > A software renderer could be exposed by adding a new EGL function on top of EGL_EXT_device_base, for example:<br>
> ><br>
> > // EGL_MESA_device_software<br>
> ><br>
> > EGLBoolean eglQuerySoftwareDeviceMESA(EGLDeviceEXT *swdevice);<br>
> ><br>
> ><br>
> > You would get the swrast device from that function instead of eglQueryDevicesEXT. It clearly separates hw and sw devices but keeps everything else the same.<br>
> ><br>
> IMHO the current EGL_MESA_device_software approach is perfectly valid.<br>
> The Query API provides the devices and one can query their<br>
> capabilities/device extensions.<br>
<br>
I agree with that. Well to repeat myself.<br>
<br>
For me there is also a basic consistency argument behind.<br>
So, Marek, you propose that the swrast device should only show<br>
up when there is no other device. That means swrast qualifies in<br>
principle as a 'device'.<br>
But if there is an other 'device' then swrast is not a 'device' anymore?<br>
I can not quite understand that from the outside.<br>
Means if swrast qualifies as a device in one configuration if should also<br>
be a device in any other configuration.<br>
<br>
There is also a next problem. I can understand that AMD wants to avoid<br>
for a customer to grab the swrast device by accident and get worse performance.<br>
But where do you draw the line then? Do you want to block out a drm device<br>
that comes up as a administration console device in such a typical compute<br>
cluster when there is an AMD device available? I mean for the same reason,<br>
where you want to avoid an application to grab the matrox device on that board<br>
that is put there for some sort of framebuffer console? If does AMD then negotiate with<br>
the Intel guys if their chip qualifies as 'device' in this sense?<br>
Do you then maintain a list of 'hardware devices' that qualify for a 'real device' then?<br>
<br>
As I said I can understand that the first device should be a GPU hardware backed device<br>
when possible to catch those simple example programs that only grab the first device.<br>
And I am still in favor of sorting this device list in a different way than it is today.<br>
<br>
Looking at that, it's probably a bit more educative to have the swrast device there in<br>
any case. That makes the average developer making use of that api aware that he has to<br>
look a bit closer at the devices before blindly using the first one. This awareness makes<br>
the administrative console device case being handled in the using application. That in turn<br>
will probably lead to the final effect that I would like to see as a GPU vendor, that is<br>
applications grab a GPU backed device and users are happy with the performance.<br>
<br>
As Emil mentions, you can find out if you grabed a swrast device or not.<br>
There is the case that your device is DRM backed, or swrast, or nothing - then its nvidia closed.<br>
<br>
> As far as I can see you have valid concerns:<br>
>  - HW devices should be the first/default<br>
>  - the SW device should work, if exposed<br>
>  - one may want to omit the SW one all together<br>
> <br>
> At the same time:<br>
>  - the device_base extension is explicit that at least one device must<br>
> be present<br>
>  - manipulating the EGL client extension string, before we determine<br>
> the driver is a PITA<br>
> <br>
> How about:<br>
>  - whip a quick (admittedly gross) hack that makes SW work<br>
>  - flip the order so SW is always the last one in the list<br>
>  - add a hack that disables SW all-together?<br>
<br>
I would vote for reordering the device list to have swrast in the last position.<br>
<br>
> <br>
> The first two should be OK to upstream, although I'd suggest keeping<br>
> the last one in AMDGPU-PRO.<br>
> Reason being is that the pro packaging can enforce that radeonsi is<br>
> always present. While we cannot do that for distributions :-\<br>
> <br>
> /me starts working on the patches<br>
<br>
Emil, if that helps:<br>
The tests already work well also with swrast in<br>
<a href="https://gitlab.freedesktop.org/frohlich/mesa/commits/egl-device-5" rel="noreferrer" target="_blank">https://gitlab.freedesktop.org/frohlich/mesa/commits/egl-device-5</a><br>
There are also Mareks latest pbuffer fixes in that branch.<br>
Sure that is not a ready to merge patch series...<br>
<br>
best<br>
<br>
Mathias<br>
<br>
<br>
</blockquote></div>