From patchwork Tue Apr 3 03:57:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 10320545 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 C64CA60532 for ; Tue, 3 Apr 2018 03:57:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A659D28A24 for ; Tue, 3 Apr 2018 03:57:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9B34028A37; Tue, 3 Apr 2018 03:57:30 +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 2997028A24 for ; Tue, 3 Apr 2018 03:57:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C43C46E114; Tue, 3 Apr 2018 03:57:27 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pl0-x244.google.com (mail-pl0-x244.google.com [IPv6:2607:f8b0:400e:c01::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id 353CA6E114 for ; Tue, 3 Apr 2018 03:57:26 +0000 (UTC) Received: by mail-pl0-x244.google.com with SMTP id v18-v6so5144968ply.12 for ; Mon, 02 Apr 2018 20:57:26 -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=W3/Pi689QUpCX4oL9fusFuwNnwm+iSaKagqDUTWqw58=; b=PkSKGly/thdtu7smdoFsSdW+YD9/i3jK2rG/q2KRxT6el8l15Xe/et+TvkRjzA/BZZ O1/OByqH5Se6FsXvh1QH+a8e/WyOWx2n1RRjnZpuMjkrbrS397t9Rt3JcwqZy4G+qZLZ vnbk/L9PZU3mAK1kivzjc6k3pyH45vuPpdUNc= 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=W3/Pi689QUpCX4oL9fusFuwNnwm+iSaKagqDUTWqw58=; b=hNwDfhXdRD5VqZ2Thv03JSjzZEdHRLiw7zWQAztotEqBYiMf0xWWATpVkAbvrqm404 GkofG4zq5D1OS0yh4M+FDo7RqftUzewtuDnvFgAfECKuyUXNArhJeHNxdsGaaO/JJMZD Ir0satAiyE9YWfFX1SVLgCY81KrbcX/1/nHVHAl3wKaki0iJ2AnCm6Wy3Yr1Htq72VVb bEGpd/+c6xfl1usRhMG1t9+7i6HCpLt43iFfg3dJC8Kr6gNFbUNi4Q4dBVEWFJNmzaB2 WQAyoLTD9WzG/gkY6UYRnS3k/0SNl/qEfqQs1Rb+kERUOC7W4YSb8gV2oy5AqGGssyqJ rTsg== X-Gm-Message-State: AElRT7H9U8j36UDuyDK10IhfP3Jgcxt/+MsR+EJtDmASZR0LskEjWB62 TxPmLK7hNiY016W025FRTQLGok/pdpQ= X-Google-Smtp-Source: AIpwx48Hcko2QWxfIzRqtHFzuwE6pjPBf6/FcF3l9SBoV/nYyUbXo5HfqJzt4CoFYekWWrlh8rpiKQ== X-Received: by 2002:a17:902:82c2:: with SMTP id u2-v6mr12116234plz.401.1522727845080; Mon, 02 Apr 2018 20:57:25 -0700 (PDT) Received: from localhost.localdomain ([2601:1c2:600:5100:4e72:b9ff:fe99:466a]) by smtp.gmail.com with ESMTPSA id f6sm2265589pgo.54.2018.04.02.20.57.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 02 Apr 2018 20:57:24 -0700 (PDT) From: John Stultz To: dri-devel Subject: [RFC][PATCH v2] drm_hwcomposer: Rework platformdrmgeneric.cpp to use libdrm's gralloc handle Date: Mon, 2 Apr 2018 20:57:21 -0700 Message-Id: <1522727841-22086-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 , Stefan Schake 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 Cc: Stefan Schake Signed-off-by: John Stultz --- 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 #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;