[xf86-video-armada][PATCH 1/2] Remove 24bbp support

Christian Gmeiner christian.gmeiner at gmail.com
Fri Aug 17 16:15:29 UTC 2018


Am Fr., 17. Aug. 2018 um 16:05 Uhr schrieb Stefan Agner <stefan at agner.ch>:
>
> 24bbp support has been removed in X.Org Server 1.20 so
> remove it from this driver as well.

Would it not be better to conditionally remove 24bbp support based on
FB_24_32BIT existence? If this driver
gets build against an older version of xserver api we would regress
regarding 24bbp support. But keep in mind
this are just my 2 cent :) I am not even sure if 24bbp gets used in the wild.

Something like:

------>8----------

diff --git a/common/unaccel.c b/common/unaccel.c
index 15cc7d5..b0d807e 100644
--- a/common/unaccel.c
+++ b/common/unaccel.c
@@ -192,6 +192,7 @@ static void unaccel_fixup_tile(DrawablePtr pDraw,
PixmapPtr *ppPix)
 {
  PixmapPtr pNew, pPixmap = *ppPix;

+#ifdef FB_24_32BIT
  if (pPixmap->drawable.bitsPerPixel != pDraw->bitsPerPixel) {
  prepare_cpu_drawable(&pPixmap->drawable, CPU_ACCESS_RO);
  pNew = fb24_32ReformatTile(pPixmap, pDraw->bitsPerPixel);
@@ -200,6 +201,7 @@ static void unaccel_fixup_tile(DrawablePtr pDraw,
PixmapPtr *ppPix)
  pDraw->pScreen->DestroyPixmap(pPixmap);
  *ppPix = pPixmap = pNew;
  }
+#endif

  if (FbEvenTile(pPixmap->drawable.width * pPixmap->drawable.bitsPerPixel)) {
  prepare_cpu_drawable(&pPixmap->drawable, CPU_ACCESS_RW);

------>8----------


>
> Signed-off-by: Stefan Agner <stefan at agner.ch>
> ---
>  common/unaccel.c  |  9 ---------
>  etnaviv/etnaviv.c | 26 --------------------------
>  vivante/vivante.c | 26 --------------------------
>  3 files changed, 61 deletions(-)
>
> diff --git a/common/unaccel.c b/common/unaccel.c
> index 15cc7d5..6a776ac 100644
> --- a/common/unaccel.c
> +++ b/common/unaccel.c
> @@ -192,15 +192,6 @@ static void unaccel_fixup_tile(DrawablePtr pDraw, PixmapPtr *ppPix)
>  {
>         PixmapPtr pNew, pPixmap = *ppPix;
>
> -       if (pPixmap->drawable.bitsPerPixel != pDraw->bitsPerPixel) {
> -               prepare_cpu_drawable(&pPixmap->drawable, CPU_ACCESS_RO);
> -               pNew = fb24_32ReformatTile(pPixmap, pDraw->bitsPerPixel);
> -               finish_cpu_drawable(&pPixmap->drawable, CPU_ACCESS_RO);
> -
> -               pDraw->pScreen->DestroyPixmap(pPixmap);
> -               *ppPix = pPixmap = pNew;
> -       }
> -
>         if (FbEvenTile(pPixmap->drawable.width * pPixmap->drawable.bitsPerPixel)) {
>                 prepare_cpu_drawable(&pPixmap->drawable, CPU_ACCESS_RW);
>                 fbPadPixmap(pPixmap);
> diff --git a/etnaviv/etnaviv.c b/etnaviv/etnaviv.c
> index c7ec66b..c04477b 100644
> --- a/etnaviv/etnaviv.c
> +++ b/etnaviv/etnaviv.c
> @@ -387,32 +387,6 @@ etnaviv_ValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable)
>  {
>         struct etnaviv *etnaviv = etnaviv_get_screen_priv(pDrawable->pScreen);
>
> -#ifdef FB_24_32BIT
> -       if (changes & GCTile && fbGetRotatedPixmap(pGC)) {
> -               pGC->pScreen->DestroyPixmap(fbGetRotatedPixmap(pGC));
> -               fbGetRotatedPixmap(pGC) = NULL;
> -       }
> -       if (pGC->fillStyle == FillTiled) {
> -               PixmapPtr pOldTile = pGC->tile.pixmap;
> -               PixmapPtr pNewTile;
> -
> -               if (pOldTile->drawable.bitsPerPixel != pDrawable->bitsPerPixel) {
> -                       pNewTile = fbGetRotatedPixmap(pGC);
> -                       if (!pNewTile || pNewTile->drawable.bitsPerPixel != pDrawable->bitsPerPixel) {
> -                               if (pNewTile)
> -                                       pGC->pScreen->DestroyPixmap(pNewTile);
> -                               prepare_cpu_drawable(&pOldTile->drawable, CPU_ACCESS_RO);
> -                               pNewTile = fb24_32ReformatTile(pOldTile, pDrawable->bitsPerPixel);
> -                               finish_cpu_drawable(&pOldTile->drawable, CPU_ACCESS_RO);
> -                       }
> -                       if (pNewTile) {
> -                               fbGetRotatedPixmap(pGC) = pOldTile;
> -                               pGC->tile.pixmap = pNewTile;
> -                               changes |= GCTile;
> -                       }
> -               }
> -       }
> -#endif
>         if (changes & GCTile) {
>                 if (!pGC->tileIsPixel &&
>                     FbEvenTile(pGC->tile.pixmap->drawable.width *
> diff --git a/vivante/vivante.c b/vivante/vivante.c
> index 8e65c13..834bc30 100644
> --- a/vivante/vivante.c
> +++ b/vivante/vivante.c
> @@ -253,32 +253,6 @@ static GCOps vivante_unaccel_GCOps = {
>  static void
>  vivante_ValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable)
>  {
> -#ifdef FB_24_32BIT
> -       if (changes & GCTile && fbGetRotatedPixmap(pGC)) {
> -               pGC->pScreen->DestroyPixmap(fbGetRotatedPixmap(pGC));
> -               fbGetRotatedPixmap(pGC) = NULL;
> -       }
> -       if (pGC->fillStyle == FillTiled) {
> -               PixmapPtr pOldTile = pGC->tile.pixmap;
> -               PixmapPtr pNewTile;
> -
> -               if (pOldTile->drawable.bitsPerPixel != pDrawable->bitsPerPixel) {
> -                       pNewTile = fbGetRotatedPixmap(pGC);
> -                       if (!pNewTile || pNewTile->drawable.bitsPerPixel != pDrawable->bitsPerPixel) {
> -                               if (pNewTile)
> -                                       pGC->pScreen->DestroyPixmap(pNewTile);
> -                               prepare_cpu_drawable(&pOldTile->drawable, CPU_ACCESS_RO);
> -                               pNewTile = fb24_32ReformatTile(pOldTile, pDrawable->bitsPerPixel);
> -                               finish_cpu_drawable(&pOldTile->drawable, CPU_ACCESS_RO);
> -                       }
> -                       if (pNewTile) {
> -                               fbGetRotatedPixmap(pGC) = pOldTile;
> -                               pGC->tile.pixmap = pNewTile;
> -                               changes |= GCTile;
> -                       }
> -               }
> -       }
> -#endif
>         if (changes & GCTile) {
>                 if (!pGC->tileIsPixel &&
>                     FbEvenTile(pGC->tile.pixmap->drawable.width *
> --
> 2.18.0
>
> _______________________________________________
> etnaviv mailing list
> etnaviv at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/etnaviv



--
greets
--
Christian Gmeiner, MSc

https://christian-gmeiner.info


More information about the etnaviv mailing list