[Mesa-dev] [PATCH 15/40] pipe-loader: rework the sw backend

Emil Velikov emil.l.velikov at gmail.com
Mon Oct 19 10:34:28 PDT 2015


On 19 October 2015 at 17:03, Brian Paul <brianp at vmware.com> wrote:
> On 10/17/2015 04:57 PM, Emil Velikov wrote:
>>
>> Move the winsys into the pipe-target, bla bla bla
>>
>> XXX: separate pipe-drivers are likely to be busted
>>
>> Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
>> ---
>>   src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c | 94
>> +++++++++++++++++-----
>>   src/gallium/include/state_tracker/sw_driver.h      | 21 +++++
>>   src/gallium/targets/d3dadapter9/Makefile.am        |  3 +-
>>   src/gallium/targets/dri/Makefile.am                |  3 +-
>>   src/gallium/targets/omx/Makefile.am                |  3 +-
>>   src/gallium/targets/opencl/Makefile.am             |  1 -
>>   src/gallium/targets/pipe-loader/Makefile.am        |  5 ++
>>   src/gallium/targets/pipe-loader/pipe.sym           |  2 +-
>>   src/gallium/targets/pipe-loader/pipe_swrast.c      | 34 +++++++-
>>   src/gallium/targets/va/Makefile.am                 |  3 +-
>>   src/gallium/targets/vdpau/Makefile.am              |  3 +-
>>   src/gallium/targets/xa/Makefile.am                 |  3 +-
>>   src/gallium/targets/xvmc/Makefile.am               |  3 +-
>>   src/gallium/tests/trivial/Makefile.am              |  1 -
>>   14 files changed, 140 insertions(+), 39 deletions(-)
>>   create mode 100644 src/gallium/include/state_tracker/sw_driver.h
>>
>> diff --git a/src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c
>> b/src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c
>> index c61f2b8..0f28541 100644
>> --- a/src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c
>> +++ b/src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c
>> @@ -35,9 +35,11 @@
>>   #include "sw/wrapper/wrapper_sw_winsys.h"
>>   #include "target-helpers/inline_sw_helper.h"
>>   #include "state_tracker/drisw_api.h"
>> +#include "state_tracker/sw_driver.h"
>>
>>   struct pipe_loader_sw_device {
>>      struct pipe_loader_device base;
>> +   const struct sw_driver_descriptor *dd;
>>      struct util_dl_library *lib;
>>      struct sw_winsys *ws;
>>   };
>> @@ -49,13 +51,23 @@ static struct pipe_loader_ops pipe_loader_sw_ops;
>>   static bool
>>   pipe_loader_sw_probe_init_common(struct pipe_loader_sw_device *sdev)
>>   {
>> -   if (!sdev->ws)
>> -      return false;
>> -
>>      sdev->base.type = PIPE_LOADER_DEVICE_SOFTWARE;
>>      sdev->base.driver_name = "swrast";
>>      sdev->base.ops = &pipe_loader_sw_ops;
>>
>> +   sdev->lib = pipe_loader_find_module(&sdev->base, PIPE_SEARCH_DIR);
>> +   if (!sdev->lib)
>> +      return false;
>> +
>> +   sdev->dd = (const struct sw_driver_descriptor *)
>> +      util_dl_get_proc_address(sdev->lib, "swrast_driver_descriptor");
>> +
>> +   if (!sdev->dd){
>> +      util_dl_close(sdev->lib);
>> +      sdev->lib = NULL;
>> +      return false;
>> +   }
>> +
>>      return true;
>>   }
>>
>> @@ -68,11 +80,24 @@ pipe_loader_sw_probe_dri(struct pipe_loader_device
>> **devs, struct drisw_loader_f
>>      if (!sdev)
>>         return false;
>>
>> -   sdev->ws = dri_create_sw_winsys(drisw_lf);
>>      if (!pipe_loader_sw_probe_init_common(sdev)) {
>>         FREE(sdev);
>>         return false;
>>      }
>> +
>> +   for (int i = 0; sdev->dd->winsys; i++) {
>
>
> I'm not 100% sure, but I think some compiler environments might choke on
> declaring the variable inside the loop.
>
Neither autotools nor scons warned about these (with Jose's MSVC
compat CFLAGS). Will fix, yet I'm mostly interested if the function
pointers list idea doesn't seem too ugly ?

Thanks
Emil


More information about the mesa-dev mailing list