From patchwork Thu Nov 7 05:42:22 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Keith Packard X-Patchwork-Id: 3151071 Return-Path: X-Original-To: patchwork-dri-devel@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 6F93DBEEB2 for ; Thu, 7 Nov 2013 05:42:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8D942205B7 for ; Thu, 7 Nov 2013 05:42:39 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 70D9B2051A for ; Thu, 7 Nov 2013 05:42:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 345AF385D5; Wed, 6 Nov 2013 21:42:35 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from keithp.com (home.keithp.com [63.227.221.253]) by gabe.freedesktop.org (Postfix) with ESMTP id 240EA385CB for ; Wed, 6 Nov 2013 21:42:28 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by keithp.com (Postfix) with ESMTP id 930531488005; Wed, 6 Nov 2013 21:42:27 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at keithp.com Received: from keithp.com ([127.0.0.1]) by localhost (keithp.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id K0_wRgZpbtgy; Wed, 6 Nov 2013 21:42:24 -0800 (PST) Received: by keithp.com (Postfix, from userid 1033) id 2C2A41488002; Wed, 6 Nov 2013 21:42:23 -0800 (PST) Received: from miki.keithp.com (localhost [127.0.0.1]) by keithp.com (Postfix) with ESMTP id EDA5E14A8016; Wed, 6 Nov 2013 21:42:23 -0800 (PST) Received: by miki.keithp.com (Postfix, from userid 1001) id 7F3B3AF8; Wed, 6 Nov 2013 21:42:23 -0800 (PST) From: Keith Packard To: Christopher James Halse Rogers , Kristian =?utf-8?Q?H=C3=B8gsberg?= Subject: Re: [PATCH 3/8] dri/intel: Add explicit size parameter to intel_region_alloc_for_fd In-Reply-To: <1383801467.26497.16.camel@RedTail> References: <1383618208-21310-1-git-send-email-keithp@keithp.com> <1383618208-21310-4-git-send-email-keithp@keithp.com> <20131105222300.GA5220@tokamak.local> <1383801467.26497.16.camel@RedTail> User-Agent: Notmuch/0.16 (http://notmuchmail.org) Emacs/23.4.1 (i486-pc-linux-gnu) Date: Wed, 06 Nov 2013 21:42:22 -0800 Message-ID: <86r4asydhd.fsf@miki.keithp.com> MIME-Version: 1.0 Cc: mesa3d-dev@lists.freedesktop.org, dri-devel@lists.freedesktop.org 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: , 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 Christopher James Halse Rogers writes: > You've presumably noticed this already, but this is the wrong way round > - you're passing height * stride as pitch, and stride as size. This > makes for awesome rendering. Thanks for catching this; I've flipped them around, and also fixed the fact that these calls were passing '1' for cpp, which appears to not actually matter most of the time, but as the correct value was sitting there in the image structure for the taking, I added that as well. You reviewed this on IRC, so I'll be merging it into the commit on my branch, just putting it here for other people to look at: diff --git a/src/mesa/drivers/dri/i915/intel_screen.c b/src/mesa/drivers/dri/i915/intel_screen.c index 38badec..3ac5aa2 100644 --- a/src/mesa/drivers/dri/i915/intel_screen.c +++ b/src/mesa/drivers/dri/i915/intel_screen.c @@ -608,8 +608,8 @@ intel_create_image_from_fds(__DRIscreen *screen, return NULL; image->region = intel_region_alloc_for_fd(intelScreen, - 1, width, height, height * strides[0], - strides[0], fds[0], "image"); + f->planes[0].cpp, width, height, strides[0], + height * strides[0], fds[0], "image"); if (image->region == NULL) { free(image); return NULL; diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c index 7571921..dcfde97 100644 --- a/src/mesa/drivers/dri/i965/intel_screen.c +++ b/src/mesa/drivers/dri/i965/intel_screen.c @@ -663,8 +663,8 @@ intel_create_image_from_fds(__DRIscreen *screen, return NULL; image->region = intel_region_alloc_for_fd(intelScreen, - 1, width, height, height * strides[0], - strides[0], fds[0], "image"); + f->planes[0].cpp, width, height, strides[0], + height * strides[0], fds[0], "image"); if (image->region == NULL) { free(image); return NULL;