[Mesa-dev] [PATCH 07/25] dri/nouveau: add GLX_MESA_query_renderer support
Pekka Paalanen
ppaalanen at gmail.com
Sat Feb 22 23:24:39 PST 2014
On Sat, 22 Feb 2014 03:03:57 +0000
Emil Velikov <emil.l.velikov at gmail.com> wrote:
> v2: nv04-2x cards support upto opengl 1.3.
> v3: Include correct headers.
>
> Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
> ---
> src/mesa/drivers/dri/nouveau/nouveau_screen.c | 83 ++++++++++++++++++++++++++-
> 1 file changed, 82 insertions(+), 1 deletion(-)
...
I still think there is something funny here:
> +static int
> +nouveau_query_renderer_integer(__DRIscreen *psp, int param,
> + unsigned int *value)
> +{
> + const struct nouveau_screen *const screen =
> + (struct nouveau_screen *) psp->driverPrivate;
> +
> + switch (param) {
> + case __DRI2_RENDERER_VENDOR_ID:
> + value[0] = 0x10de;
> + return 0;
> + case __DRI2_RENDERER_DEVICE_ID: {
> + struct drm_nouveau_getparam gp;
> + int *chip_id = 0, ret;
chip_id is set to NULL.
> +
> + memset(&gp, 0, sizeof(gp));
> + gp.param = NOUVEAU_GETPARAM_PCI_DEVICE;
> + gp.value = (unsigned long) chip_id;
gp.value is now 0 (NULL).
> +
> + ret = drmCommandWriteRead(psp->fd, DRM_NOUVEAU_GETPARAM, &gp, sizeof(gp));
> + if (ret) {
> + nouveau_error("Error retrieving NOUVEAU_GETPARAM_PCI_DEVICE.\n");
> + *chip_id = -1;
Dereferencing NULL.
> + }
> + value[0] = *chip_id;
Dereferencing NULL.
Am I missing something? You didn't mention anything about this when
Ilia pointed it out.
Thanks,
pq
> + return 0;
> + }
More information about the mesa-dev
mailing list