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: 132699 Delivered-To: patches@linaro.org Received: by 10.46.84.29 with SMTP id i29csp3322815ljb; Mon, 2 Apr 2018 20:57:25 -0700 (PDT) X-Received: by 10.101.69.198 with SMTP id m6mr7938036pgr.244.1522727845703; Mon, 02 Apr 2018 20:57:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522727845; cv=none; d=google.com; s=arc-20160816; b=afsqPu8jwxc7aofHsDmZVrBWxxDZEEHNA+DkbnM2OhkqRO2bwbTbBmsc8pusWaLMyz HItabB9mIVTSCN9AqkuxFylbDOiZ1traNTw8My2uzrSRxw67ggoasvm2OIP4cXojo4oV 5A6GK2vnWf/egBlqCye5NLmUWZ0Z68+NMIkoeLthV4lH77/yIG/Yzsj6ITGKyajPOtZr QiIyTdXVuvyKBXCd5eKtxYDlyANKKFw1cLIRk6/QTYZjJ50EOzdZJcXadNodPrBfkAuO M2iIvLjpHbH3R9sG2mJv3lByB6M/5txR6zjhY8JsUzbP0jMZvOihYW1eUFIB752x6T/6 3rBw== 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=W3/Pi689QUpCX4oL9fusFuwNnwm+iSaKagqDUTWqw58=; b=JklxiHrDapzhzqHdFJ4kaRqiCh0lyAPLZlgrXvPzfqRoLJYwYruf0tDp9/ACugdlge ag+R3UYhlUOf9qsqzH9/Ph/1EwPOHHJlDfh2/J1ELIToirl6XX1bu5Tx5U937rpy37LJ 65ohz9I18M6DdWgraqCqCWvyXzQDGK7VvJQbd0EWHfdWCRuzdoc33x7ffu3ha4JYKZGU 77y7BxvBAfkjgsJgH8hNpOP104cRiyfqKdbrFN6zSlQDdwR+s1DxrAURNzc84zDVmaAN YAQMm4PzK90cnT839f4peXRyAb9xtkHnEcpGzeJIs7Rad687bJgl38TJctFeyze2xLAt PYdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PkSKGly/; 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 bh5-v6sor776067plb.135.2018.04.02.20.57.25 for (Google Transport Security); Mon, 02 Apr 2018 20:57:25 -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=PkSKGly/; 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=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=r8I7pqqXtDFtBQ3XEoLSWfNUacydSpVLdZ8sLtVW14eN8lo4+pnlVWgEJUog9+07AE vREE4MtPiJOD/I9ecsrqVXFTqKyDKZa6QO4RKgUVp9a9sZQhM4dHoaGvOA/xfUyApfHL 3llmCt17aIBieAUT5KNxF1nAKDeCAYgwzn7XKnzpt9S7BQkR/QNtKLLd0dWUF+YmJk7W x5pd72riPgeP2iD9r8RicvU89l1zkCLp9bCFogUM+fTbHV+FFiNnGLVZ/vwFZx1cduw6 o1PveSdzNeFeSyqIfs5Y3EYIPB3Bt3FSgJKTXdN1DN6YMHFMMWprqMb+RSQRFkBBwNaE Aa9g== X-Gm-Message-State: AElRT7GsxZX+ZA3g5o2G9P3581nrbrW3WDYngIABj5RjtrJ6ThgKwQKB 7EznD0H73sOPygwcP2wOJfkt63OY 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) Return-Path: 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 Cc: John Stultz , Robert Foss , Rob Herring , Sean Paul , Stefan Schake 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 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(-) -- 2.7.4 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;