Hi Qiang Yu, Couple of suggestions mentioned before apply here as well.
On 3 August 2018 at 09:19, Qiang Yu <qiang...@amd.com> wrote: > v2: > add kernel_driver device attribute to specify kernel > driver name instead of reuse driver attribute. > Please move to the end of the commit message. Can you split things up a bit: - refactoring - to reduce the ifdef hunk, simply add no-op func. stubs - the new dri_driver handling - loader_get_dri_config_driver will use NULL for kernel_driver - the new kernel_driver handling > +static char *loader_get_dri_config_driver(int fd) > +{ > + driOptionCache defaultInitOptions; > + driOptionCache userInitOptions; > + char *dri_driver = NULL; > + char *kernel_driver = loader_get_kernel_driver_name(fd); > + > + driParseOptionInfo(&defaultInitOptions, __driConfigOptionsLoader); > + driParseConfigFiles(&userInitOptions, &defaultInitOptions, 0, > + "loader", kernel_driver); > + if (driCheckOption(&userInitOptions, "dri_driver", DRI_STRING)) { > + char *opt = driQueryOptionstr(&userInitOptions, "dri_driver"); > + /* not an empty string */ > + if (*opt) > + dri_driver = strdup(opt); > + } > + driDestroyOptionCache(&userInitOptions); > + driDestroyOptionInfo(&defaultInitOptions); > + > + if (kernel_driver) Nit: free(NULL) is safe, drop the check. HTH Emil _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev