[Mesa-dev] [PATCH] dri: Include kernel release in vendor info
Chris Wilson
chris at chris-wilson.co.uk
Wed Oct 10 08:03:21 UTC 2018
Quoting Ian Romanick (2018-10-10 00:24:00)
> On 10/09/2018 06:24 AM, Chris Wilson wrote:
> > The userspace driver does not exist in isolation and occasionally
> > depends on kernel uapi, and so it is useful in bug reports to include
> > that information. (radeonsi, r600 and radv already include utsname)
> >
> > References: https://bugs.freedesktop.org/show_bug.cgi?id=108282
> > ---
> > src/mesa/drivers/dri/common/utils.c | 6 ++++++
> > 1 file changed, 6 insertions(+)
> >
> > diff --git a/src/mesa/drivers/dri/common/utils.c b/src/mesa/drivers/dri/common/utils.c
> > index 5a66bcf8e05..4d0d654dbfd 100644
> > --- a/src/mesa/drivers/dri/common/utils.c
> > +++ b/src/mesa/drivers/dri/common/utils.c
> > @@ -34,6 +34,8 @@
> > #include <stdlib.h>
> > #include <stdbool.h>
> > #include <stdint.h>
> > +#include <sys/utsname.h>
> > +
> > #include "main/macros.h"
> > #include "main/mtypes.h"
> > #include "main/cpuinfo.h"
> > @@ -77,11 +79,15 @@ unsigned
> > driGetRendererString( char * buffer, const char * hardware_name,
> > GLuint agp_mode )
> > {
> > + struct utsname uts;
> > unsigned offset;
> > char *cpu;
> >
> > offset = sprintf( buffer, "Mesa DRI %s", hardware_name );
> >
> > + if (uname(&uts) == 0)
> > + offset += sprintf(buffer + offset, " [%s]", uts.release);
>
> Is there any kind of a limit on how big uts.release can be? All of the
> callers pass a fixed-size buffer into the function, and the function has
> no way to know how big that buffer is.
Currently defined at 64 + '\0'. The function can always be replaced by
one that does know buflen.
-Chris
More information about the mesa-dev
mailing list