From patchwork Sun Mar 23 14:18:45 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 3879031 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 78985BF540 for ; Sun, 23 Mar 2014 14:19:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 90B40201BF for ; Sun, 23 Mar 2014 14:19:28 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 72266201BA for ; Sun, 23 Mar 2014 14:19:27 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 054886E68C; Sun, 23 Mar 2014 07:19:27 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-ee0-f47.google.com (mail-ee0-f47.google.com [74.125.83.47]) by gabe.freedesktop.org (Postfix) with ESMTP id 309196E690 for ; Sun, 23 Mar 2014 07:19:26 -0700 (PDT) Received: by mail-ee0-f47.google.com with SMTP id b15so3484731eek.6 for ; Sun, 23 Mar 2014 07:19:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=jBKYvN7TyWadgmn2SHq8abv/Z9n3Zqs8lf3Pqly/eQA=; b=L/g8sxsxYKVqEOl+i3gjik++JR4Wr7mviJ2OC9VNl6+do3t2kK4G+4LyKfpnOmFnoN MPNz0ib2eVIAJPh0cpmMMySL5iUHio6BbUU9UrI/oDNq1aMoh5nQCfnF8T+8Wu/OCpNG 9GoLAE3PF595DuVphbukcnFlAX4YCrXld76zM= 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=jBKYvN7TyWadgmn2SHq8abv/Z9n3Zqs8lf3Pqly/eQA=; b=daed9V624JW76UVkyN4bvYNTdYHk6BZ0Y3QM8FL2hW5zbXcG0oUZ6TOu2Qkl6GKDLT J3zecDjcEdzAYdVPK5MPAK7apNJuweMOgmzA5O8q94COBR7K8EkilX8ULWBD9WosKZD5 KaWqJdyk3mhOh32VT4jFasOiLaGv7x+fpsoum8L4S0aozfFz91ebyu23fnoQiLZb4lKP trCBIow6EuR9KgKMZgcuXRmpxxlosnfEzhdk5v9TXS/wpz3Sn6uypf3JHFGwU/pisZDU 6057SG2W5j2d/LN8o/d1xZn6C7Ul8W+4vUoKOPDF6NV2phyE+OQd1lWpHW8jvdOpVrMy AMBg== X-Gm-Message-State: ALoCoQkjo+8TYRfLFrKeftvLzR2SS9nkwB6LchATq/w/y/sXBoqSYX7Z6yvc6DV4bZ3rxHowyZP2 X-Received: by 10.14.200.195 with SMTP id z43mr21566637een.52.1395584365457; Sun, 23 Mar 2014 07:19:25 -0700 (PDT) Received: from phenom.ffwll.local (84-73-67-144.dclient.hispeed.ch. [84.73.67.144]) by mx.google.com with ESMTPSA id cb5sm26392589eeb.18.2014.03.23.07.19.24 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 23 Mar 2014 07:19:24 -0700 (PDT) From: Daniel Vetter To: Intel Graphics Development Date: Sun, 23 Mar 2014 15:18:45 +0100 Message-Id: <1395584342-11812-12-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 1.8.5.2 In-Reply-To: <1395584342-11812-1-git-send-email-daniel.vetter@ffwll.ch> References: <1395584342-11812-1-git-send-email-daniel.vetter@ffwll.ch> Cc: Daniel Vetter Subject: [Intel-gfx] [PATCH 11/28] lib/intel_batchbuffer: api documentation for render copy/media fill X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,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 Also fix a fumble in the documentation for intel_blt_copy. One thing we might want to do is unify the parameter ordering here a bit ... Again gtkdoc fails to pick up the documentation for struct igt_buf :( Signed-off-by: Daniel Vetter --- lib/intel_batchbuffer.c | 41 +++++++++++++++++++++++++++++++++++-- lib/intel_batchbuffer.h | 54 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 93 insertions(+), 2 deletions(-) diff --git a/lib/intel_batchbuffer.c b/lib/intel_batchbuffer.c index 6a585c7df967..3a38f13326ec 100644 --- a/lib/intel_batchbuffer.c +++ b/lib/intel_batchbuffer.c @@ -286,8 +286,8 @@ intel_batchbuffer_data(struct intel_batchbuffer *batch, * @src_y1: source pixel y-coordination * @src_pitch: @src_bo's pitch in bytes * @dst_bo: destination libdrm buffer object - * @dst_x1: source pixel x-coordination - * @dst_y1: source pixel y-coordination + * @dst_x1: destination pixel x-coordination + * @dst_y1: destination pixel y-coordination * @dst_pitch: @dst_bo's pitch in bytes * @width: width of the copied rectangle * @height: height of the copied rectangle @@ -387,16 +387,44 @@ intel_copy_bo(struct intel_batchbuffer *batch, 4096/4, size/4096, 32); } +/** + * igt_buf_width: + * @buf: the i-g-t buffer object + * + * Computes the widht in 32-bit pixels of the given buffer. + * + * Returns: + * The width of the buffer. + */ unsigned igt_buf_width(struct igt_buf *buf) { return buf->stride/sizeof(uint32_t); } +/** + * igt_buf_height: + * @buf: the i-g-t buffer object + * + * Computes the height in 32-bit pixels of the given buffer. + * + * Returns: + * The height of the buffer. + */ unsigned igt_buf_height(struct igt_buf *buf) { return buf->size/buf->stride; } +/** + * igt_get_render_copyfunc: + * @devid: pci device id + * + * Returns: + * + * The platform-specific render copy function pointer for the device + * specified with @devid. Will return NULL when no render copy function is + * implemented. + */ igt_render_copyfunc_t igt_get_render_copyfunc(int devid) { igt_render_copyfunc_t copy = NULL; @@ -415,6 +443,15 @@ igt_render_copyfunc_t igt_get_render_copyfunc(int devid) return copy; } +/** + * igt_get_media_fillfunc: + * @devid: pci device id + * + * Returns: + * + * The platform-specific media fill function pointer for the device specified + * with @devid. Will return NULL when no media fill function is implemented. + */ igt_media_fillfunc_t igt_get_media_fillfunc(int devid) { igt_media_fillfunc_t fill = NULL; diff --git a/lib/intel_batchbuffer.h b/lib/intel_batchbuffer.h index 6a65f6f7b36f..b3e4b8ffd4e5 100644 --- a/lib/intel_batchbuffer.h +++ b/lib/intel_batchbuffer.h @@ -196,6 +196,22 @@ void intel_copy_bo(struct intel_batchbuffer *batch, drm_intel_bo *dst_bo, drm_intel_bo *src_bo, long int size); +/** + * igt_buf: + * @bo: underlying libdrm buffer object + * @stride: stride of the buffer + * @tiling: tiling mode bits + * @data: pointer to the memory mapping of the buffer + * @size: size of the buffer object + * @num_tiles: number of tiles of the buffer object + * + * This is a i-g-t buffer object wrapper structure which augments the baseline + * libdrm buffer object with suitable data needed by the render copy and the + * media fill functions. + * + * Note that @num_tiles is only used by gem_stress.c internally and can be + * ignored. + */ struct igt_buf { drm_intel_bo *bo; uint32_t stride; @@ -208,6 +224,27 @@ struct igt_buf { unsigned igt_buf_width(struct igt_buf *buf); unsigned igt_buf_height(struct igt_buf *buf); +/** + * igt_render_copyfunc_t: + * @batch: batchbuffer object + * @context: libdrm hardware context to use + * @src: source i-g-t buffer object + * @src_x: source pixel x-coordination + * @src_y: source pixel y-coordination + * @width: width of the copied rectangle + * @height: height of the copied rectangle + * @dst: destination i-g-t buffer object + * @dst_x: destination pixel x-coordination + * @dst_y: destination pixel y-coordination + * + * This is the type of the per-platform render copy functions. The + * platform-specific implementation can be obtained by calling + * igt_get_render_copyfunc(). + * + * A render copy function will emit a batchbuffer to the kernel which executes + * the specified blit copy operation using the render engine. @context is + * optional and can be NULL. + */ typedef void (*igt_render_copyfunc_t)(struct intel_batchbuffer *batch, drm_intel_context *context, struct igt_buf *src, unsigned src_x, unsigned src_y, @@ -216,6 +253,23 @@ typedef void (*igt_render_copyfunc_t)(struct intel_batchbuffer *batch, igt_render_copyfunc_t igt_get_render_copyfunc(int devid); +/** + * igt_media_fillfunc_t: + * @batch: batchbuffer object + * @dst: destination i-g-t buffer object + * @x: destination pixel x-coordination + * @y: destination pixel y-coordination + * @width: width of the filled rectangle + * @height: height of the filled rectangle + * @color: fill color to use + * + * This is the type of the per-platform media fill functions. The + * platform-specific implementation can be obtained by calling + * igt_get_media_fillfunc(). + * + * A media fill function will emit a batchbuffer to the kernel which executes + * the specified blit fill operation using the media engine. + */ typedef void (*igt_media_fillfunc_t)(struct intel_batchbuffer *batch, struct igt_buf *dst, unsigned x, unsigned y,