From patchwork Tue Feb 14 10:18:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 9571635 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 2F65E60578 for ; Tue, 14 Feb 2017 10:18:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 195D9280CF for ; Tue, 14 Feb 2017 10:18:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0C70E2836B; Tue, 14 Feb 2017 10:18:40 +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 C3E3C280CF for ; Tue, 14 Feb 2017 10:18:39 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2B87B6E64B; Tue, 14 Feb 2017 10:18:39 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-x244.google.com (mail-wm0-x244.google.com [IPv6:2a00:1450:400c:c09::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0DCA76E64B for ; Tue, 14 Feb 2017 10:18:37 +0000 (UTC) Received: by mail-wm0-x244.google.com with SMTP id v77so2768105wmv.0 for ; Tue, 14 Feb 2017 02:18:36 -0800 (PST) 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=2n54v8LFoVKs+puMOwFygadsBuiLoYhK6UZ+qufVIMk=; b=pqQQvWGXhMsBRNiKA1FLeUkbTOq69ENzH99ukGNEq6af1dQhscaAe6lRUqTfoElLKc 5DRmIGPBZfxSsA8V86w2Avk1Nl8jBKYsp5r2ydKHkqrw9hYRGdk4yqX59OwyVi9vjIP0 h/CraIKbMU9BwEtVwvpWzyQCyPM85p/pgOVTIKzVMU2SagBEamXANAC0KlvjEsI+dhQD DHwaLAGXB/42IbL5X/p90lpeCGpYSFnlFlCjOhf792VSJO6y8rokMuS+pMjkTu62kTc1 eud5Q1tcJeal7Awms6TuuKWAsoeXzPzLtbFXb0+nwE8Ucc5jScgeAzknhcErpQQ1j1/6 AUFQ== 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=2n54v8LFoVKs+puMOwFygadsBuiLoYhK6UZ+qufVIMk=; b=ol7OwC1iOABjiPyHr9NflcyqdI8r+8KvF+g1ytfioqOZQ9YojMK45Kuo9og2T6uZdD 5atDM9ynQlYBTXZEoODhOdzjTIwJc0L7F6UmUqMWGsKPtxCVjGSK0U/UW474PquU5h/D /myLHbWCM+Up7MEgdOX5HN4EYjVjGuuaBEKsaPx/8lcJqL88Ei6z+7DtI4d7lDY6VfWH 4VR0GXYMysKadyZ50UGmfCYqDY9Zw5ZefsvV4hp83reOEEgiFJ5g567Jfz/LcZzJdIXa L8wacFpOB+dMAkLRkX4U8XFCVSdknEGME08vN2KW7tmy44BVYR/M/+2kQKssu8qTIqnB ujhA== X-Gm-Message-State: AMke39kC3DLSdHE9smxIspv5+oy0qDIhTZn3bljky6xBfPBRJpcffxa7GCYutLXhIqD0Zw== X-Received: by 10.28.158.82 with SMTP id h79mr2591674wme.30.1487067515592; Tue, 14 Feb 2017 02:18:35 -0800 (PST) Received: from haswell.alporthouse.com ([78.156.65.138]) by smtp.gmail.com with ESMTPSA id g5sm179774wrd.0.2017.02.14.02.18.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Feb 2017 02:18:33 -0800 (PST) From: Chris Wilson To: dri-devel@lists.freedesktop.org Subject: [PATCH 1/2] drm/i915: Use helper for setting plane->state->fb Date: Tue, 14 Feb 2017 10:18:31 +0000 Message-Id: <20170214101832.725-1-chris@chris-wilson.co.uk> X-Mailer: git-send-email 2.11.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP We are told not to set plane_state->fb directly, but use drm_atomic_set_fb_for_plane() instead. Using the helper, means one less piece of code that needs fixing should the interface change... Signed-off-by: Chris Wilson Reviewed-by: Eric Engestrom --- drivers/gpu/drm/i915/intel_display.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 04ca4e7bbbe0..7f7f6de011a4 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -2666,11 +2666,7 @@ update_state_fb(struct drm_plane *plane) if (plane->fb == plane->state->fb) return; - if (plane->state->fb) - drm_framebuffer_unreference(plane->state->fb); - plane->state->fb = plane->fb; - if (plane->state->fb) - drm_framebuffer_reference(plane->state->fb); + drm_atomic_set_fb_for_plane(plane->state, plane->fb); } static void