"Fossies" - the Fresh Open Source Software Archive

Member "qt-everywhere-src-6.3.1/qtwayland/src/3rdparty/patches/0001-Add-a-EGL_DRM_BUFFER_FORMAT_A8_MESA-9.2.patch" (8 Jun 2022, 4677 Bytes) of package /linux/misc/qt-everywhere-src-6.3.1.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Diff source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 From 52dbed7516b79459d1c8f2ed3ea4a5e71734c969 Mon Sep 17 00:00:00 2001
    2 From: Jorgen Lind <jorgen.lind@digia.com>
    3 Date: Thu, 2 Jan 2014 12:28:54 +0100
    4 Subject: [PATCH] Add a EGL_DRM_BUFFER_FORMAT_A8_MESA
    5 
    6 This is to allow us to share A8 DRM buffers between processes
    7 ---
    8  include/EGL/eglext.h                     | 1 +
    9  include/GL/internal/dri_interface.h      | 1 +
   10  src/egl/drivers/dri2/egl_dri2.c          | 7 +++++++
   11  src/mesa/drivers/dri/i915/intel_screen.c | 5 +++++
   12  src/mesa/drivers/dri/i965/intel_screen.c | 5 +++++
   13  5 files changed, 19 insertions(+)
   14 
   15 diff --git a/include/EGL/eglext.h b/include/EGL/eglext.h
   16 index 1d68178..6c4fb7e 100644
   17 --- a/include/EGL/eglext.h
   18 +++ b/include/EGL/eglext.h
   19 @@ -271,6 +271,7 @@ typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPIXMAPSURFACEHIPROC) (EGLDisplay dp
   20  #define EGL_DRM_BUFFER_FORMAT_MESA     0x31D0      /* CreateDRMImageMESA attribute */
   21  #define EGL_DRM_BUFFER_USE_MESA            0x31D1      /* CreateDRMImageMESA attribute */
   22  #define EGL_DRM_BUFFER_FORMAT_ARGB32_MESA  0x31D2      /* EGL_IMAGE_FORMAT_MESA attribute value */
   23 +#define EGL_DRM_BUFFER_FORMAT_A8_MESA          0x31D5      /* EGL_IMAGE_FORMAT_MESA attribute value */
   24  #define EGL_DRM_BUFFER_MESA            0x31D3      /* eglCreateImageKHR target */
   25  #define EGL_DRM_BUFFER_STRIDE_MESA     0x31D4
   26  #define EGL_DRM_BUFFER_USE_SCANOUT_MESA        0x00000001  /* EGL_DRM_BUFFER_USE_MESA bits */
   27 diff --git a/include/GL/internal/dri_interface.h b/include/GL/internal/dri_interface.h
   28 index 5c99d55..565f1fb 100644
   29 --- a/include/GL/internal/dri_interface.h
   30 +++ b/include/GL/internal/dri_interface.h
   31 @@ -964,6 +964,7 @@ struct __DRIdri2ExtensionRec {
   32  #define __DRI_IMAGE_FORMAT_R8           0x1006 /* Since version 5 */
   33  #define __DRI_IMAGE_FORMAT_GR88         0x1007
   34  #define __DRI_IMAGE_FORMAT_NONE         0x1008
   35 +#define __DRI_IMAGE_FORMAT_A8           0x1009 /* Patch */
   36  
   37  #define __DRI_IMAGE_USE_SHARE      0x0001
   38  #define __DRI_IMAGE_USE_SCANOUT        0x0002
   39 diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
   40 index a8584b7..1cb6967 100644
   41 --- a/src/egl/drivers/dri2/egl_dri2.c
   42 +++ b/src/egl/drivers/dri2/egl_dri2.c
   43 @@ -1152,6 +1152,10 @@ dri2_create_image_mesa_drm_buffer(_EGLDisplay *disp, _EGLContext *ctx,
   44        format = __DRI_IMAGE_FORMAT_ARGB8888;
   45        pitch = attrs.DRMBufferStrideMESA;
   46        break;
   47 +   case EGL_DRM_BUFFER_FORMAT_A8_MESA:
   48 +      format = __DRI_IMAGE_FORMAT_A8;
   49 +      pitch = attrs.DRMBufferStrideMESA;
   50 +      break;
   51     default:
   52        _eglError(EGL_BAD_PARAMETER,
   53         "dri2_create_image_khr: unsupported pixmap depth");
   54 @@ -1427,6 +1431,9 @@ dri2_create_drm_image_mesa(_EGLDriver *drv, _EGLDisplay *disp,
   55     case EGL_DRM_BUFFER_FORMAT_ARGB32_MESA:
   56        format = __DRI_IMAGE_FORMAT_ARGB8888;
   57        break;
   58 +   case EGL_DRM_BUFFER_FORMAT_A8_MESA:
   59 +      format = __DRI_IMAGE_FORMAT_A8;
   60 +      break;
   61     default:
   62        _eglLog(_EGL_WARNING, "bad image format value 0x%04x",
   63              attrs.DRMBufferFormatMESA);
   64 diff --git a/src/mesa/drivers/dri/i915/intel_screen.c b/src/mesa/drivers/dri/i915/intel_screen.c
   65 index 30a867e..3e1909b 100644
   66 --- a/src/mesa/drivers/dri/i915/intel_screen.c
   67 +++ b/src/mesa/drivers/dri/i915/intel_screen.c
   68 @@ -261,6 +261,9 @@ intel_allocate_image(int dri_format, void *loaderPrivate)
   69      case __DRI_IMAGE_FORMAT_R8:
   70         image->format = MESA_FORMAT_R8;
   71         break;
   72 +    case __DRI_IMAGE_FORMAT_A8:
   73 +       image->format = MESA_FORMAT_A8;
   74 +       break;
   75      case __DRI_IMAGE_FORMAT_GR88:
   76         image->format = MESA_FORMAT_GR88;
   77         break;
   78 @@ -330,6 +333,8 @@ intel_dri_format(GLuint format)
   79        return __DRI_IMAGE_FORMAT_ABGR8888;
   80     case MESA_FORMAT_R8:
   81        return __DRI_IMAGE_FORMAT_R8;
   82 +   case MESA_FORMAT_A8:
   83 +      return __DRI_IMAGE_FORMAT_A8;
   84     case MESA_FORMAT_RG88:
   85        return __DRI_IMAGE_FORMAT_GR88;
   86     }
   87 diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c
   88 index f913c42..68ee33b 100644
   89 --- a/src/mesa/drivers/dri/i965/intel_screen.c
   90 +++ b/src/mesa/drivers/dri/i965/intel_screen.c
   91 @@ -262,6 +262,9 @@ intel_allocate_image(int dri_format, void *loaderPrivate)
   92      case __DRI_IMAGE_FORMAT_R8:
   93         image->format = MESA_FORMAT_R8;
   94         break;
   95 +    case __DRI_IMAGE_FORMAT_A8:
   96 +       image->format = MESA_FORMAT_A8;
   97 +       break;
   98      case __DRI_IMAGE_FORMAT_GR88:
   99         image->format = MESA_FORMAT_GR88;
  100         break;
  101 @@ -334,6 +337,8 @@ intel_dri_format(GLuint format)
  102        return __DRI_IMAGE_FORMAT_ABGR8888;
  103     case MESA_FORMAT_R8:
  104        return __DRI_IMAGE_FORMAT_R8;
  105 +   case MESA_FORMAT_A8:
  106 +      return __DRI_IMAGE_FORMAT_A8;
  107     case MESA_FORMAT_RG88:
  108        return __DRI_IMAGE_FORMAT_GR88;
  109     }
  110 -- 
  111 1.8.5.1
  112