From patchwork Wed Mar 22 20:59:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 9640077 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3B6B3601E9 for ; Wed, 22 Mar 2017 20:59:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 28B5728420 for ; Wed, 22 Mar 2017 20:59:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1C95328485; Wed, 22 Mar 2017 20:59:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 804AA28420 for ; Wed, 22 Mar 2017 20:59:35 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 08ACB6E984; Wed, 22 Mar 2017 20:59:35 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wm0-x243.google.com (mail-wm0-x243.google.com [IPv6:2a00:1450:400c:c09::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0BD9A6E984; Wed, 22 Mar 2017 20:59:34 +0000 (UTC) Received: by mail-wm0-x243.google.com with SMTP id x124so12952928wmf.3; Wed, 22 Mar 2017 13:59:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id; bh=CcfXjcIj0eUQjVFv0xx6p8RaaMdOZmCbPLNrQIIJIwk=; b=NWKDdovgF2fJgmvdSWO5jlRhxLLHvb1OfrH2F7cDD5C/pFbrPbcuLiAgIHkQ6c/tTD plE9Dm8dddnxSUh+8+ywX1LuHZ/+yuXSADXWyi7wWH43TOyAKgUFXD+HXIoq3BEKOcEp uz7bjBwRfC61i0v9+ZfAdYTqgCXqUY6SiiQRN9FaiYAvkVLyf6cZSsSJH+asgqOrmcZP 0ASs24G/hMBt0lU0qlxoVVCMosRHsce4QuUPUF6ABCHnR54Z5PuttdQzYgGls0cCUuWB YyYT6dgTweMbdDGJalVN4wfynRvUgYeDlmYNeX+f0C1/+WCOHJ3JmjVV0FKHv5IB8W/G fKyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=CcfXjcIj0eUQjVFv0xx6p8RaaMdOZmCbPLNrQIIJIwk=; b=MqkPCaFqQ8QkdeY+YgkpmZdaYccIo4S94Zn3pdyEq8QCUMC5gSEsf22cjwYBaIGOzW Pwlp2poDqCIaUHlnomG0Lt20WNKRDbvlddf+p8dXUXBjdunkvKpw0qpWznsPhvIw9Oz5 3kEzCzl/drobi8y0E89OmWxXDI49dmaTDJ4ZWbsGBzmW0cFVh8xKM69XoDlQax3xUGgx VfZZpDsM5ixTxJRRS+pi0ccbY/L+GQkr3qRjyTLPSV07AR9GFTzkiab6PkrSMyiZPATw o+Mn5JyR1G7Yj8akQkiGzLiMlZl4NZ2Y+pvXYcBAEz0cyqXNovQ6ozrGWGNLRHQZDHR9 kuPw== X-Gm-Message-State: AFeK/H3Ji0A+zb+Mt1xtL2FKF1DpN/Rbej83u2AfIciqDYtlXY7CR9HgjfJPiE1t6QkWiQ== X-Received: by 10.28.45.212 with SMTP id t203mr9207107wmt.37.1490216372445; Wed, 22 Mar 2017 13:59:32 -0700 (PDT) Received: from haswell.alporthouse.com ([78.156.65.138]) by smtp.gmail.com with ESMTPSA id q29sm3170263wrc.49.2017.03.22.13.59.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Mar 2017 13:59:31 -0700 (PDT) From: Chris Wilson To: intel-gfx@lists.freedesktop.org Date: Wed, 22 Mar 2017 20:59:30 +0000 Message-Id: <20170322205930.12762-1-chris@chris-wilson.co.uk> X-Mailer: git-send-email 2.11.0 Cc: "# v4 . 11-rc1" Subject: [Intel-gfx] [PATCH] drm/i915: Restore marking context objects as dirty on pinning X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 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-Virus-Scanned: ClamAV using ClamSMTP Commit e8a9c58fcd9a ("drm/i915: Unify active context tracking between legacy/execlists/guc") converted the legacy intel_ringbuffer submission to the same context pinning mechanism as execlists - that is to pin the context until the subsequent request is retired. Previously it used the vma retirement of the context object to keep itself pinned until the next request (after i915_vma_move_to_active()). In the conversion, I missed that the vma retirement was also responsible for marking the object as dirty. Mark the context object as dirty when pinning (equivalent to execlists) which ensures that if the context is swapped out due to mempressure or suspend/hibernation, when it is loaded back in it does so with the previous state (and not all zero). Fixes: e8a9c58fcd9a ("drm/i915: Unify active context tracking between legacy/execlists/guc") Reported-by: Dennis Gilmore Reported-by: Mathieu Marquer Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99993 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100181 Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Cc: # v4.11-rc1 Reviewed-by: Tvrtko Ursulin --- drivers/gpu/drm/i915/intel_ringbuffer.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c index 0ca5ea7a9407..62756eb2bd4a 100644 --- a/drivers/gpu/drm/i915/intel_ringbuffer.c +++ b/drivers/gpu/drm/i915/intel_ringbuffer.c @@ -1440,6 +1440,8 @@ static int intel_ring_context_pin(struct intel_engine_cs *engine, ret = context_pin(ctx); if (ret) goto error; + + ce->state->obj->mm.dirty = true; } /* The kernel context is only used as a placeholder for flushing the