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: 10290329 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A7A0960386 for ; Fri, 16 Mar 2018 21:48:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 97B63290B3 for ; Fri, 16 Mar 2018 21:48:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8C823290C9; Fri, 16 Mar 2018 21:48:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B7AC6290B3 for ; Fri, 16 Mar 2018 21:48:43 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B35096EBFE; Fri, 16 Mar 2018 21:48:41 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pl0-x243.google.com (mail-pl0-x243.google.com [IPv6:2607:f8b0:400e:c01::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id 410456EBFF for ; Fri, 16 Mar 2018 21:48:40 +0000 (UTC) Received: by mail-pl0-x243.google.com with SMTP id f23-v6so6654978plr.10 for ; Fri, 16 Mar 2018 14:48:40 -0700 (PDT) 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=h9ASmvPGg+7gmnJQfK4RrDIT5JcLNFneDbFmpOACoASfuUs6IYua3rgLEvlYGMk/qp yrsik5tBeli/guiqm7M6fBy4slEAoicNpEXMPhXgHbn9IkrCE87/FqatuWAncV3uhGeF ItTQmZDgtBjMmrf4/M4xTpl5OfnOtPkSU3WnZOlyPfTz98JUaW/kEzM2IfIvnr3/vqvS vRZQCh3ZnwxtHdq1OFnaMizBN7zVutFmKupzI1tvxv1F7Al6jWUmZ9rp2z+UZYCG7jPd OsHwx+sDcswJkaDQfx1dR7sMsN/c2VycIg+v+93aNhANOpni0nDcIfEWVXt5kKnQgoEO zUVQ== X-Gm-Message-State: AElRT7GzWY7aTaAxJz8D+sx7o0eb7gNwMpy7oTSamZK7WroQy8zm0SYj +KVVKZk5+Lny+W7Zjx6mDDsEcTKPtAs= 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) 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 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 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Robert Foss , Rob Herring , Sean Paul MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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(-) 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;