From patchwork Tue Apr 19 20:46:03 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 718861 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p3JJs79t007952 for ; Tue, 19 Apr 2011 19:54:27 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2517F9EF48 for ; Tue, 19 Apr 2011 12:54:07 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wy0-f177.google.com (mail-wy0-f177.google.com [74.125.82.177]) by gabe.freedesktop.org (Postfix) with ESMTP id C8B059EC0F for ; Tue, 19 Apr 2011 12:51:59 -0700 (PDT) Received: by mail-wy0-f177.google.com with SMTP id 28so50785wyb.36 for ; Tue, 19 Apr 2011 12:51:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=domainkey-signature:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=2XQOLsbYKAewyaf1etvHsX1dQ0or9lapoTUJKGpsrWM=; b=DD4d/3qU3DKJsykmpWAMmZI3+YZ0Na3ahHSOm6wZAauVVDMj0VG5CiK2zUOqADN2kK L6Qk0yCPuXppE/nPtyHdr4QbPZQBCMXouKI62KIu9HuciWe9Q+6L6pYbERHRjI3vIGxk +MTlt+SQy66fJRonDE6QjuY3cgvOncLiSvtRQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=M4R2M52udmrFbedXGLh5qKc+m1crNmfYqVRPuFoRjxVePm2AJwsXLk+ATXnp0u6BLu CBrcofecsDU0Wv/0OqOozDuWsAuI5VYgA74orwa9INj1BRe1YQC/AIp1SCE/45TsftT3 uJ7CasFiwrWPvHOu2FriX4w8BgxUEucNq6sLU= Received: by 10.216.239.73 with SMTP id b51mr93127wer.60.1303242718783; Tue, 19 Apr 2011 12:51:58 -0700 (PDT) Received: from localhost.localdomain (cable-static-216-94.intergga.ch [87.102.216.94]) by mx.google.com with ESMTPS id u9sm138493wbg.34.2011.04.19.12.51.57 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 19 Apr 2011 12:51:58 -0700 (PDT) From: Daniel Vetter To: intel-gfx@lists.freedesktop.org Date: Tue, 19 Apr 2011 22:46:03 +0200 Message-Id: <1303245964-3022-5-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1303245964-3022-1-git-send-email-daniel.vetter@ffwll.ch> References: <1303245964-3022-1-git-send-email-daniel.vetter@ffwll.ch> Cc: Daniel Vetter Subject: [Intel-gfx] [PATCH 4/5] drm/i915: fix relaxed tiling on gen2: y-tiling on i855gm X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Tue, 19 Apr 2011 19:54:27 +0000 (UTC) Experiments showed that y-tiled access from the cpu doesn't work on my gen2 machine. Checking this in create_mmap_offset does not work due to libdrm bo reuse. Chris Wilson also clarified (by checking internal docs) that only i855GM has broken y-tiled fences for cpu access (guess what hw I own). Hence move the check to deny y-tiled access to gem_fault and restrict it with IS_I85X. According to docs, upload _should_ work to y-tiled textures with the blitter on all gen2 chips. Signed-off-by: Daniel Vetter --- drivers/gpu/drm/i915/i915_gem.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index f658f4f..6471d51 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -1255,6 +1255,13 @@ int i915_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf) goto unlock; } + /* i855gm has broken y-tiled fences for cpu access, blitter should work, + * though. */ + if (IS_I85X(dev) && obj->tiling_mode == I915_TILING_Y) { + ret = -EINVAL; + goto unlock; + } + /* Now bind it into the GTT if needed */ if (!obj->map_and_fenceable) { ret = i915_gem_object_unbind(obj);