[RFC xserver 08/16] Glamor: Use gbm_bo_create_with_modifiers for internal pixmap allocation

Adam Jackson ajax at nwnk.net
Tue Jun 13 20:43:49 UTC 2017


On Thu, 2017-06-08 at 19:43 +0100, Daniel Stone wrote:

> +static uint32_t
> +drm_format_for_depth(uint32_t bpp, uint32_t depth)
> +{
> +    uint32_t fmt;
> +
> +    switch (bpp) {
> +        case 8:
> +            fmt = DRM_FORMAT_C8;
> +            break;
> +        case 16:
> +            if (depth == 15)
> +                fmt = DRM_FORMAT_XRGB1555;
> +            else
> +                fmt = DRM_FORMAT_RGB565;
> +            break;
> +        case 24:
> +            fmt = DRM_FORMAT_RGB888;
> +            break;
> +        case 32:
> +            if (depth == 24)
> +                fmt = DRM_FORMAT_XRGB8888;
> +            else if (depth == 30)
> +                fmt = DRM_FORMAT_XRGB2101010;
> +            else
> +                fmt = DRM_FORMAT_ARGB8888;
> +            break;
> +        default:
> +            // XXX error
> +            fmt = DRM_FORMAT_XRGB8888;
> +            break;
> +    }
> +
> +    return fmt;
> +}

There's a copy of this in 5/16 too. Is there a better place for this?

> @@ -374,9 +413,11 @@ glamor_make_pixmap_exportable(PixmapPtr pixmap)
>          glamor_get_pixmap_private(pixmap);
>      unsigned width = pixmap->drawable.width;
>      unsigned height = pixmap->drawable.height;
> +    uint64_t modifier = 0;
>      struct gbm_bo *bo;
>      PixmapPtr exported;
>      GCPtr scratch_gc;
> +    bool ret = FALSE;

Capital B Bool, please.

- ajax


More information about the xorg-devel mailing list