All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Stultz <john.stultz@linaro.org>
To: dri-devel <dri-devel@lists.freedesktop.org>
Cc: Robert Foss <robert.foss@collabora.com>,
	Rob Herring <rob.herring@linaro.org>,
	Sean Paul <seanpaul@google.com>,
	Stefan Schake <stschake@gmail.com>
Subject: [RFC][PATCH v2] drm_hwcomposer: Rework platformdrmgeneric.cpp to use libdrm's gralloc handle
Date: Mon,  2 Apr 2018 20:57:21 -0700	[thread overview]
Message-ID: <1522727841-22086-1-git-send-email-john.stultz@linaro.org> (raw)

Rework the platformdrmgeneric buffer importer to use the libdrm
generic gralloc handle definition.

This is just to get the drm_hwcomposer project building in AOSP
along with the libdrm freedesktop/master branch. Similar changes
may also be needed to gbm_gralloc and other projects not used
in AOSP.

Mostly just sending this out for review feedback.

Cc: Robert Foss <robert.foss@collabora.com>
Cc: Rob Herring <rob.herring@linaro.org>
Cc: Sean Paul <seanpaul@google.com>
Cc: Stefan Schake <stschake@gmail.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
---
v2: Utilize libdrm exporting headers to avoid having to tweak
    the includes path, as suggsted by Stefan Schake
---
 platformdrmgeneric.cpp | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/platformdrmgeneric.cpp b/platformdrmgeneric.cpp
index 741d42b..2a6773c 100644
--- a/platformdrmgeneric.cpp
+++ b/platformdrmgeneric.cpp
@@ -25,7 +25,7 @@
 #include <xf86drmMode.h>
 
 #include <cutils/log.h>
-#include <gralloc_drm_handle.h>
+#include <gralloc_handle.h>
 #include <hardware/gralloc.h>
 #include <EGL/eglext.h>
 
@@ -85,23 +85,23 @@ uint32_t DrmGenericImporter::ConvertHalFormatToDrm(uint32_t hal_format) {
 }
 
 EGLImageKHR DrmGenericImporter::ImportImage(EGLDisplay egl_display, buffer_handle_t handle) {
-  gralloc_drm_handle_t *gr_handle = gralloc_drm_handle(handle);
+  gralloc_handle_t *gr_handle = gralloc_handle(handle);
   if (!gr_handle)
     return NULL;
   EGLint attr[] = {
-    EGL_WIDTH, gr_handle->width,
-    EGL_HEIGHT, gr_handle->height,
+    EGL_WIDTH, (EGLint)gr_handle->width,
+    EGL_HEIGHT, (EGLint)gr_handle->height,
     EGL_LINUX_DRM_FOURCC_EXT, (EGLint)ConvertHalFormatToDrm(gr_handle->format),
     EGL_DMA_BUF_PLANE0_FD_EXT, gr_handle->prime_fd,
     EGL_DMA_BUF_PLANE0_OFFSET_EXT, 0,
-    EGL_DMA_BUF_PLANE0_PITCH_EXT, gr_handle->stride,
+    EGL_DMA_BUF_PLANE0_PITCH_EXT, (EGLint)gr_handle->stride,
     EGL_NONE,
   };
   return eglCreateImageKHR(egl_display, EGL_NO_CONTEXT, EGL_LINUX_DMA_BUF_EXT, NULL, attr);
 }
 
 int DrmGenericImporter::ImportBuffer(buffer_handle_t handle, hwc_drm_bo_t *bo) {
-  gralloc_drm_handle_t *gr_handle = gralloc_drm_handle(handle);
+  gralloc_handle_t *gr_handle = gralloc_handle(handle);
   if (!gr_handle)
     return -EINVAL;
 
-- 
2.7.4

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

             reply	other threads:[~2018-04-03  3:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-03  3:57 John Stultz [this message]
2018-04-04  9:24 ` [RFC][PATCH v2] drm_hwcomposer: Rework platformdrmgeneric.cpp to use libdrm's gralloc handle Robert Foss
2018-04-04 17:33   ` John Stultz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1522727841-22086-1-git-send-email-john.stultz@linaro.org \
    --to=john.stultz@linaro.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=rob.herring@linaro.org \
    --cc=robert.foss@collabora.com \
    --cc=seanpaul@google.com \
    --cc=stschake@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.