From patchwork Fri Nov 25 09:35:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Varad Gautam X-Patchwork-Id: 84085 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp46834qgi; Fri, 25 Nov 2016 01:36:09 -0800 (PST) X-Received: by 10.84.216.28 with SMTP id m28mr15587539pli.107.1480066569138; Fri, 25 Nov 2016 01:36:09 -0800 (PST) Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id a30si15250951pli.303.2016.11.25.01.36.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 Nov 2016 01:36:09 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of piglit-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com; spf=pass (google.com: best guess record for domain of piglit-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=piglit-bounces@lists.freedesktop.org; dmarc=fail (p=NONE dis=NONE) header.from=gmail.com Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C3D196EA91; Fri, 25 Nov 2016 09:35:37 +0000 (UTC) X-Original-To: piglit@lists.freedesktop.org Delivered-To: piglit@lists.freedesktop.org Received: from mail-pg0-x241.google.com (mail-pg0-x241.google.com [IPv6:2607:f8b0:400e:c05::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8351F6EA91 for ; Fri, 25 Nov 2016 09:35:36 +0000 (UTC) Received: by mail-pg0-x241.google.com with SMTP id e9so5160779pgc.1 for ; Fri, 25 Nov 2016 01:35:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Eptbvm28YBITE96GShRdyfxUJhsz8PPo0tWurGst784=; b=HEg6lrPcNff6fiYAfhe9po/iCOdQ9b9GFsrj8z/oilNaTCcgfjaRUn4RpN2+OZUhbw hyWk9lBFbpzuT4YXXwWApEdfDz7k+U8fLva7bgvNXvtig67p+LEKKiiBfl1qq5tosnYs +Ob30MEhhRk4jQhiQL30IRzD+RWtRYfCWVx0QjOP9LiQ74Mw96N/VWEhkPLPbVBdVmii ov3XkF1KoJYpQtbuxxsgF6vnV763qLJKl1x7zsuOogSKxO3SKmLSmoctZLyzS3VWXGVq xyepOiEtFrkf9iLLUbqwnG42Nu0N7ZeCUhrkI3x5bZFtQldcYaQQm9AKE2C0ygXp+om3 OPwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Eptbvm28YBITE96GShRdyfxUJhsz8PPo0tWurGst784=; b=Nwzpah3/PrRNvWzt1HgSlkW3ZTXQC8O4KYRwuI25nmjMIpYJp3AqHDu2ZRlkxYfRIV IO6DU1K4+53u7Kp5WRUo0GWPmVedpOKKNXzPdr1IvVd0SlHEq+cKkatIEZYPwOU307oE ZpjIUtVfX9A3aozEvQZBrXPR6RmtwRd7XX4kCnizc01oVNhhnsWPzvXJs1yswzCy/+v/ j7oygnNa4v5epdU4ClEs+OXec9rDGlFX0Yq6e7sCYXjI4ZDDfoJ9WG+6vhfkPZaxOcg+ etxD8D85dJR+659uRVxQ7f7S+KgrLs33SPdn8h9g5BLlyttR/jaRFlmsH5E3iIuz3iNL 70Hw== X-Gm-Message-State: AKaTC01VnOvGf3oWEYZRHkdskYNjVz4kt9CXrBTphkDSfehnFQ0Utbi1CYt5rwm95Tt1LQ== X-Received: by 10.98.196.199 with SMTP id h68mr6752539pfk.120.1480066535769; Fri, 25 Nov 2016 01:35:35 -0800 (PST) Received: from linux-e1tz.suse ([122.168.223.25]) by smtp.googlemail.com with ESMTPSA id y73sm66241752pfa.68.2016.11.25.01.35.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 25 Nov 2016 01:35:35 -0800 (PST) From: Varad Gautam To: piglit@lists.freedesktop.org Date: Fri, 25 Nov 2016 15:05:14 +0530 Message-Id: <1480066519-20283-2-git-send-email-varadgautam@gmail.com> X-Mailer: git-send-email 2.6.2 In-Reply-To: <1480066519-20283-1-git-send-email-varadgautam@gmail.com> References: <1480066519-20283-1-git-send-email-varadgautam@gmail.com> Cc: Varad Gautam Subject: [Piglit] [PATCH 1/6] image_common: resolve EGL_EXT_image_dma_buf_import_modifiers functions X-BeenThere: piglit@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: piglit-bounces@lists.freedesktop.org Sender: "Piglit" From: Varad Gautam Signed-off-by: Varad Gautam --- tests/spec/ext_image_dma_buf_import/image_common.c | 59 ++++++++++++++++++++++ tests/spec/ext_image_dma_buf_import/image_common.h | 23 +++++++++ 2 files changed, 82 insertions(+) diff --git a/tests/spec/ext_image_dma_buf_import/image_common.c b/tests/spec/ext_image_dma_buf_import/image_common.c index af01c3d..4d2c913 100644 --- a/tests/spec/ext_image_dma_buf_import/image_common.c +++ b/tests/spec/ext_image_dma_buf_import/image_common.c @@ -75,3 +75,62 @@ stub_eglDestroyImageKHR(EGLDisplay dpy, EGLImageKHR image) PFNEGLDESTROYIMAGEKHRPROC image_common_dispatch_eglDestroyImageKHR = stub_eglDestroyImageKHR; + +static void +resolve_eglQueryDmaBufFormatsEXT() +{ + if (piglit_is_egl_extension_supported(eglGetCurrentDisplay(), + "EGL_EXT_image_dma_buf_import_modifiers")) + image_common_dispatch_eglQueryDmaBufFormatsEXT = + (PFNEGLQUERYDMABUFFORMATSEXTPROC) eglGetProcAddress( + "eglQueryDmaBufFormatsEXT"); + else + image_common_unsupported("QueryDmaBufFormatsEXT"); +} + +EGLAPI EGLBoolean EGLAPIENTRY +stub_eglQueryDmaBufFormatsEXT(EGLDisplay dpy, EGLint max_formats, + EGLint *formats, + EGLint *num_formats) +{ + resolve_eglQueryDmaBufFormatsEXT(); + return image_common_dispatch_eglQueryDmaBufFormatsEXT(dpy, + max_formats, + formats, + num_formats); +} + +PFNEGLQUERYDMABUFFORMATSEXTPROC +image_common_dispatch_eglQueryDmaBufFormatsEXT = + stub_eglQueryDmaBufFormatsEXT; +static void +resolve_eglQueryDmaBufModifiersEXT() +{ + if (piglit_is_egl_extension_supported(eglGetCurrentDisplay(), + "EGL_EXT_image_dma_buf_import_modifiers")) + image_common_dispatch_eglQueryDmaBufModifiersEXT = + (PFNEGLQUERYDMABUFMODIFIERSEXTPROC) eglGetProcAddress( + "eglQueryDmaBufModifiersEXT"); + else + image_common_unsupported("QueryDmaBufModifiersEXT"); +} + +EGLAPI EGLBoolean EGLAPIENTRY +stub_eglQueryDmaBufModifiersEXT(EGLDisplay dpy, EGLint format, + EGLint max_modifiers, + EGLuint64KHR *modifiers, + EGLBoolean *external_only, + EGLint *num_modifiers) +{ + resolve_eglQueryDmaBufModifiersEXT(); + return image_common_dispatch_eglQueryDmaBufModifiersEXT(dpy, + format, + max_modifiers, + modifiers, + external_only, + num_modifiers); +} + +PFNEGLQUERYDMABUFMODIFIERSEXTPROC +image_common_dispatch_eglQueryDmaBufModifiersEXT = + stub_eglQueryDmaBufModifiersEXT; diff --git a/tests/spec/ext_image_dma_buf_import/image_common.h b/tests/spec/ext_image_dma_buf_import/image_common.h index f9845c7..81ef7c5 100644 --- a/tests/spec/ext_image_dma_buf_import/image_common.h +++ b/tests/spec/ext_image_dma_buf_import/image_common.h @@ -73,4 +73,27 @@ extern PFNEGLCREATEIMAGEKHRPROC image_common_dispatch_eglCreateImageKHR; extern PFNEGLDESTROYIMAGEKHRPROC image_common_dispatch_eglDestroyImageKHR; #define eglDestroyImageKHR image_common_dispatch_eglDestroyImageKHR +#ifndef EGL_EXT_image_dma_buf_import_modifiers +#define EGL_EXT_image_dma_buf_import_modifiers 1 +#define EGL_DMA_BUF_PLANE3_FD_EXT 0x3440 +#define EGL_DMA_BUF_PLANE3_OFFSET_EXT 0x3441 +#define EGL_DMA_BUF_PLANE3_PITCH_EXT 0x3442 +#define EGL_DMA_BUF_PLANE0_MODIFIER_LO_EXT 0x3443 +#define EGL_DMA_BUF_PLANE0_MODIFIER_HI_EXT 0x3444 +#define EGL_DMA_BUF_PLANE1_MODIFIER_LO_EXT 0x3445 +#define EGL_DMA_BUF_PLANE1_MODIFIER_HI_EXT 0x3446 +#define EGL_DMA_BUF_PLANE2_MODIFIER_LO_EXT 0x3447 +#define EGL_DMA_BUF_PLANE2_MODIFIER_HI_EXT 0x3448 +#define EGL_DMA_BUF_PLANE3_MODIFIER_LO_EXT 0x3449 +#define EGL_DMA_BUF_PLANE3_MODIFIER_HI_EXT 0x344A +typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYDMABUFFORMATSEXTPROC) (EGLDisplay dpy, EGLint max_formats, EGLint *formats, EGLint *num_formats); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYDMABUFMODIFIERSEXTPROC) (EGLDisplay dpy, EGLint format, EGLint max_modifiers, EGLuint64KHR *modifiers, EGLBoolean *external_only, EGLint *num_modifiers); +#endif + +extern PFNEGLQUERYDMABUFFORMATSEXTPROC image_common_dispatch_eglQueryDmaBufFormatsEXT; +#define eglQueryDmaBufFormatsEXT image_common_dispatch_eglQueryDmaBufFormatsEXT + +extern PFNEGLQUERYDMABUFMODIFIERSEXTPROC image_common_dispatch_eglQueryDmaBufModifiersEXT; +#define eglQueryDmaBufModifiersEXT image_common_dispatch_eglQueryDmaBufModifiersEXT + #endif /* IMAGE_COMMON_H */