[Mesa-dev] [PATCH 09/12] egl: Adding Haiku configs, not stable yet

Emil Velikov emil.l.velikov at gmail.com
Mon Dec 22 07:54:43 PST 2014


On 22/12/14 15:32, kallisti5 wrote:
> On 2014-12-22 09:24, Emil Velikov wrote:
>> On 22/12/14 14:36, Alexander von Gluck IV wrote:
>>> From: Adrián Arroyo Calle <adrian.arroyocalle at gmail.com>
>>>
>>> ---
>>>  src/egl/drivers/dri2/egl_dri2.c         |    7 ++
>>>  src/egl/drivers/dri2/platform_haiku.cpp |  172
>>> +++++++++++++++++++++++++------
>>>  src/egl/main/SConscript                 |   14 ++-
>>>  src/egl/main/egldisplay.c               |    4 +
>>>  4 files changed, 160 insertions(+), 37 deletions(-)
>>>
>>> diff --git a/src/egl/drivers/dri2/egl_dri2.c
>>> b/src/egl/drivers/dri2/egl_dri2.c
>>> index 062fb54..5bda4fd 100644
>>> --- a/src/egl/drivers/dri2/egl_dri2.c
>>> +++ b/src/egl/drivers/dri2/egl_dri2.c
>>> @@ -398,9 +398,16 @@ dri2_open_driver(_EGLDisplay *disp)
>>>             "%.*s/tls/%s_dri.so", len, p, dri2_dpy->driver_name);
>>>        dri2_dpy->driver = dlopen(path, RTLD_NOW | RTLD_GLOBAL);
>>>  #endif
>>> +
>>> +
>>>        if (dri2_dpy->driver == NULL) {
>>> +#ifndef HAVE_HAIKU_PLATFORM
>>>       snprintf(path, sizeof path,
>>>            "%.*s/%s_dri.so", len, p, dri2_dpy->driver_name);
>>> +#else
>>> +     snprintf(path, sizeof path,
>>> +          "lib%s.so",len,p,dri2_dpy->driver_name);
>>> +#endif
>> Imho Haiku's way of "reinventing" the DRI model/modules is rather
>> unfortunate, and it would be nice if it can just follow suite. Unless of
>> course there is some real (technical) reasons which prohibits it from
>> going otherwise.
> 
> A few reasons:
> 
>   * libpciaccess needs ported to Haiku to use dri2 or wrapper code needs
> created.
Don't know of anything (but a single function in the intel drm) that
uses/need libpciaccess. And that one is not dri2 either afaict.

>   * our video card driver model is substantially different from Linux
> splitting
>     apart the card driver from the card functions.  The driver only enables
>     multiple accelerants to connect to the card device
> (/dev/graphics/radeonhd_0_0)
>     at once.  The driver sets up memory areas and passes these areas to
> each
>     accelerant.  It could be done but it would require someone with deep
> understanding
>     of dri2 and Haiku's graphics card stack.
I was secretly hoping that Adrián will have some time/knowledge to look
into that. I feel that I'm a bit too optimistic.

>   * Our OpenGL subsystem works using the Mesa GL Dispatch code adding
> additional complexity.
>     http://cgit.freedesktop.org/mesa/mesa/tree/src/hgl/GLDispatcher.cpp
> 
> 
> And the biggest reason:
>   * I don't have a ton of free time anymore due to a baby :-)
> 
Congratulations :-)

> If someone smarter than me could figure out how to do dri2 in a way that
> makes sense
> we would likely jump on it to help reduce upkeep for Mesa (and us)
> 
It's not about just upkeep, but about design and it's limitations. Iirc
most people at #dri-devel mentioned that (parts of) your graphics system
resembles dri1, which was proven to be "fun".

Cheers,
Emil



More information about the mesa-dev mailing list