From patchwork Fri Mar 16 21:48:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 131944 Delivered-To: patches@linaro.org Received: by 10.46.84.17 with SMTP id i17csp72966ljb; Fri, 16 Mar 2018 14:48:39 -0700 (PDT) X-Received: by 2002:a17:902:102:: with SMTP id 2-v6mr3675414plb.48.1521236919600; Fri, 16 Mar 2018 14:48:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521236919; cv=none; d=google.com; s=arc-20160816; b=Xn4P77ecj9IDQS+ALlkbi7DMhyESBQSisV/09W1FGrUi00EESJv0yalMP/oW+AbzgP CY8AFIve6mVZ1gyAT4RWkYaLbHjyWLOY5m9tNAtWwr0+tfKe6StRvHcFXkRJiVldBafm iXlJquKYIxPraLO6DYkFH0LnrtcFfgZsbD5s8RtFTQ3sfbZSspj8IK1V/+sRw2s7cdHN IRAeC1Jxm0rGHyHNQ08b5SxO4U6gQSeACtSji1MySWSYyt1IaYcQicsB6hI25+pUL9qs Tlj0Pp0EEZtHcVaNletyzNefVGyGb75r45jwfEu717Hll4QBH6aH54Q4vBOgO+xv8yab Jw5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=hX8g7vAsD88emx2egwNgpVLvrbh/9va4NtjVRm0IOr8=; b=DigcfjuRct7DuqrQhSUmLqDOJJESpaEp3gIJUb2OPztkxuI8Mck+dicv93QZQsAq5M QIS6g5rm2X/tTQJvg9vMeJG1xbHMYKLIvGpUGeWYAWNGmZ5CVSsQgY7OZqHrJuYujp7L wKbKSxOIs2aFic+4g5c8PuJR4EIYLypihXdkHK0WLroNdH4GHKqysWavQYiTQpdG0cSo ToDXAkTKF2Vb3UMVw3qIq0JeliHLcAzt3IGy0KcjQXuVeddPbpthM4RsthKhmTP4kQ77 A0OaxXgVeJdXgLIPUrsPbWU1cgUSGuAz6BVdwrkCihdm/sSsrG/rzUPDkgjRv/euqL28 2mCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jgkQ7oPJ; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id v20-v6sor3228596plo.148.2018.03.16.14.48.39 for (Google Transport Security); Fri, 16 Mar 2018 14:48:39 -0700 (PDT) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jgkQ7oPJ; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=hX8g7vAsD88emx2egwNgpVLvrbh/9va4NtjVRm0IOr8=; b=jgkQ7oPJMwI/xKcxffMeDbMeSIROSFX274A7Wo+IQfIruoyiRxYEJa8Z2PWt7ZOVjj wXYOOX96QPzcpJ1DX4jr96s4wmaMNOQyKg7uL395VAZka30vUXYN2KUPsbxbXOd3zGwG zGoNcd7QzpM9sOGXJRnMpULSEexf+RZU42EnA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=hX8g7vAsD88emx2egwNgpVLvrbh/9va4NtjVRm0IOr8=; b=f+42nRUS6MbbZj6w7G2lM3h6skvla2F8spvFch8d7cBQnhOg/GF4zLnRAKhg8pRwqI d1bjQUEXSLViIa5k9WLiVnH4ylK9n/nEhweLz++u/zBo9qZ1qrj7jf6vV0IfIyZBIpkj 7D17WCWcyGY8SKrnPVuemAvAdZQ4aMfUw4uoG0HccCi5Q+JgNoKre52vbA5W207ONl58 xU1BxkVprvLy24XeA66zMyxINoY+SsldScDFz4y6VOLt4xapw4IEluwyxEbHlOXvZ1pY oYPTvAwC20OndaLFzF8YbY92NpsuxcivNO5tV4cWanWx0II8OTM628F7cdNAyXUkocfZ MmVw== X-Gm-Message-State: AElRT7H4zOAFjIyEiqs7xWijo2jIEe6jUEO7jga9b/2UtvX3xU/rpThG nWOzQS+/0xMqnpHTmQafIbcqGq5r X-Google-Smtp-Source: AG47ELse7fMcnpI+vVdPOkQkp6WPfTEa/M1NqgfgP7e2UqV6xu31BkicZQypLZSYG0p6cEZQz7+aNw== X-Received: by 2002:a17:902:aa83:: with SMTP id d3-v6mr3608625plr.36.1521236919077; Fri, 16 Mar 2018 14:48:39 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([2601:1c2:600:5100:4e72:b9ff:fe99:466a]) by smtp.gmail.com with ESMTPSA id w129sm18798087pfd.155.2018.03.16.14.48.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 16 Mar 2018 14:48:37 -0700 (PDT) From: John Stultz To: dri-devel Cc: John Stultz , Robert Foss , Rob Herring , Sean Paul Subject: [RFC][PATCH] drm_hwcomposer: Rework platformdrmgeneric.cpp to use libdrm's gralloc handle Date: Fri, 16 Mar 2018 14:48:35 -0700 Message-Id: <1521236915-21187-1-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 2.7.4 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 Cc: Rob Herring Cc: Sean Paul Signed-off-by: John Stultz --- Android.mk | 2 +- platformdrmgeneric.cpp | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) -- 2.7.4 diff --git a/Android.mk b/Android.mk index 1add286..383de1c 100644 --- a/Android.mk +++ b/Android.mk @@ -47,7 +47,7 @@ LOCAL_SHARED_LIBRARIES := \ LOCAL_STATIC_LIBRARIES := libdrmhwc_utils LOCAL_C_INCLUDES := \ - external/drm_gralloc \ + external/libdrm/android \ system/core/libsync LOCAL_SRC_FILES := \ diff --git a/platformdrmgeneric.cpp b/platformdrmgeneric.cpp index 741d42b..2a6773c 100644 --- a/platformdrmgeneric.cpp +++ b/platformdrmgeneric.cpp @@ -25,7 +25,7 @@ #include #include -#include +#include #include #include @@ -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;