From patchwork Mon Jun 22 10:37:46 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 6654641 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8E54A9F399 for ; Mon, 22 Jun 2015 10:37:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C46CA20613 for ; Mon, 22 Jun 2015 10:37:00 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id B987820610 for ; Mon, 22 Jun 2015 10:36:59 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DAC8F6E73F; Mon, 22 Jun 2015 03:36:58 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from galahad.ideasonboard.com (galahad.ideasonboard.com [185.26.127.97]) by gabe.freedesktop.org (Postfix) with ESMTP id 3E3176E73F for ; Mon, 22 Jun 2015 03:36:57 -0700 (PDT) Received: from avalon.home (a91-152-136-245.elisa-laajakaista.fi [91.152.136.245]) by galahad.ideasonboard.com (Postfix) with ESMTPSA id 480F5203AA; Mon, 22 Jun 2015 12:35:51 +0200 (CEST) From: Laurent Pinchart To: dri-devel@lists.freedesktop.org Subject: [PATCH v2] drm/atomic: Don't set crtc_state->enable manually Date: Mon, 22 Jun 2015 13:37:46 +0300 Message-Id: <1434969466-25615-1-git-send-email-laurent.pinchart+renesas@ideasonboard.com> X-Mailer: git-send-email 2.3.6 Cc: Daniel Vetter , Daniel Stone 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-Spam-Status: No, score=-5.6 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 The enable field needs to be kept in sync with the mode_blob field. Call drm_atomic_set_mode_prop_for_crtc() instead of setting enable to false in order to dereference the mode blob correctly. Signed-off-by: Laurent Pinchart --- drivers/gpu/drm/drm_atomic_helper.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) Changes since v1: - Check the return value of drm_atomic_set_mode_prop_for_crtc() - Drop the num_connectors local variable diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index 536ae4da4665..ec3d65a497ac 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c @@ -1561,10 +1561,14 @@ static int update_output_state(struct drm_atomic_state *state, if (crtc == set->crtc) continue; - crtc_state->enable = - drm_atomic_connectors_for_crtc(state, crtc); - if (!crtc_state->enable) + if (!drm_atomic_connectors_for_crtc(state, crtc)) { + ret = drm_atomic_set_mode_prop_for_crtc(crtc_state, + NULL); + if (ret < 0) + return ret; + crtc_state->active = false; + } } return 0;