From patchwork Mon Nov 11 17:48:26 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Romanick X-Patchwork-Id: 3169001 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8646A9F39E for ; Mon, 11 Nov 2013 17:53:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9EC492039A for ; Mon, 11 Nov 2013 17:53:48 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 7A0802037F for ; Mon, 11 Nov 2013 17:53:47 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 424F0FA813; Mon, 11 Nov 2013 09:53:44 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from expn.cat.pdx.edu (expn.cat.pdx.edu [131.252.208.110]) by gabe.freedesktop.org (Postfix) with ESMTP id B17EBFA813; Mon, 11 Nov 2013 09:53:42 -0800 (PST) Received: from idr ([127.0.0.1])(authenticated bits=0) by expn.cat.pdx.edu (8.14.4/8.14.4/Debian-2ubuntu2) with ESMTP id rABHmbLv026715 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 11 Nov 2013 09:48:40 -0800 From: "Ian Romanick" To: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH 1/2] intel: Add accessor to get HW context ID from a drm_intel_context Date: Mon, 11 Nov 2013 09:48:26 -0800 Message-Id: <1384192107-14314-1-git-send-email-idr@freedesktop.org> X-Mailer: git-send-email 1.8.1.4 X-Virus-Scanned: clamav-milter 0.97.8 at expn X-Virus-Status: Clean Cc: Ben Widawsky , Ian Romanick X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Ian Romanick The drm_intel_context structure is, wisely, opaque. However, libdrm users may want to know the hardware context ID associated with the structure. Signed-off-by: Ian Romanick Cc: Ben Widawsky Reviewed-by: Eric Anholt Acked-by: Ben Widawsky --- intel/intel_bufmgr.h | 1 + intel/intel_bufmgr_gem.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/intel/intel_bufmgr.h b/intel/intel_bufmgr.h index 15f818e..7b28a70 100644 --- a/intel/intel_bufmgr.h +++ b/intel/intel_bufmgr.h @@ -194,6 +194,7 @@ drm_intel_context *drm_intel_gem_context_create(drm_intel_bufmgr *bufmgr); void drm_intel_gem_context_destroy(drm_intel_context *ctx); int drm_intel_gem_bo_context_exec(drm_intel_bo *bo, drm_intel_context *ctx, int used, unsigned int flags); +unsigned int drm_intel_gem_context_get_hw_context_id(const drm_intel_context *); int drm_intel_bo_gem_export_to_prime(drm_intel_bo *bo, int *prime_fd); drm_intel_bo *drm_intel_bo_gem_create_from_prime(drm_intel_bufmgr *bufmgr, diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c index 029ca5d..5b64a7f 100644 --- a/intel/intel_bufmgr_gem.c +++ b/intel/intel_bufmgr_gem.c @@ -3020,6 +3020,12 @@ drm_intel_gem_context_destroy(drm_intel_context *ctx) free(ctx); } +unsigned int +drm_intel_gem_context_get_hw_context_id(const drm_intel_context *ctx) +{ + return ctx->ctx_id; +} + int drm_intel_reg_read(drm_intel_bufmgr *bufmgr, uint32_t offset,