From patchwork Mon Jun 15 10:33:38 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maarten Lankhorst X-Patchwork-Id: 6608001 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D2B34C0433 for ; Mon, 15 Jun 2015 10:34:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DD3C220595 for ; Mon, 15 Jun 2015 10:34:17 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 7F864204E0 for ; Mon, 15 Jun 2015 10:34:16 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 19A046E730; Mon, 15 Jun 2015 03:34:15 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mblankhorst.nl (mblankhorst.nl [141.105.120.124]) by gabe.freedesktop.org (Postfix) with ESMTP id 9733E6E734 for ; Mon, 15 Jun 2015 03:34:13 -0700 (PDT) Received: from patser.lan (5ED48611.cm-7-5c.dynamic.ziggo.nl [94.212.134.17]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: mlankhorst) by mblankhorst.nl (Postfix) with ESMTPSA id BBFD218C012; Mon, 15 Jun 2015 12:34:10 +0200 (CEST) From: Maarten Lankhorst To: intel-gfx@lists.freedesktop.org Date: Mon, 15 Jun 2015 12:33:38 +0200 Message-Id: <1434364436-6366-2-git-send-email-maarten.lankhorst@linux.intel.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1434364436-6366-1-git-send-email-maarten.lankhorst@linux.intel.com> References: <1434364436-6366-1-git-send-email-maarten.lankhorst@linux.intel.com> Subject: [Intel-gfx] [PATCH v3 01/19] drm/i915: Use crtc state in intel_modeset_pipe_config 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-Spam-Status: No, score=-4.7 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 Grabbing crtc state from atomic state is a lot more involved, and make sure connectors are added before calling this function. Move check_digital_port_conflicts to intel_modeset_checks, it's only useful to check it on a modeset. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/intel_display.c | 39 ++++++++++++++---------------------- 1 file changed, 15 insertions(+), 24 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 5974e995676d..d36684080987 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -12044,10 +12044,9 @@ clear_intel_crtc_state(struct intel_crtc_state *crtc_state) static int intel_modeset_pipe_config(struct drm_crtc *crtc, - struct drm_atomic_state *state) + struct intel_crtc_state *pipe_config) { - struct drm_crtc_state *crtc_state; - struct intel_crtc_state *pipe_config; + struct drm_atomic_state *state = pipe_config->base.state; struct intel_encoder *encoder; struct drm_connector *connector; struct drm_connector_state *connector_state; @@ -12060,26 +12059,6 @@ intel_modeset_pipe_config(struct drm_crtc *crtc, return -EINVAL; } - if (!check_digital_port_conflicts(state)) { - DRM_DEBUG_KMS("rejecting conflicting digital port configuration\n"); - return -EINVAL; - } - - crtc_state = drm_atomic_get_existing_crtc_state(state, crtc); - if (WARN_ON(!crtc_state)) - return -EINVAL; - - pipe_config = to_intel_crtc_state(crtc_state); - - /* - * XXX: Add all connectors to make the crtc state match the encoders. - */ - if (!needs_modeset(&pipe_config->base)) { - ret = drm_atomic_add_affected_connectors(state, crtc); - if (ret) - return ret; - } - clear_intel_crtc_state(pipe_config); pipe_config->cpu_transcoder = @@ -12907,6 +12886,11 @@ static int intel_modeset_checks(struct drm_atomic_state *state) struct drm_device *dev = state->dev; int ret; + if (!check_digital_port_conflicts(state)) { + DRM_DEBUG_KMS("rejecting conflicting digital port configuration\n"); + return -EINVAL; + } + /* * See if the config requires any additional preparation, e.g. * to adjust global state with pipes off. We need to do this @@ -12953,7 +12937,14 @@ intel_modeset_compute_config(struct drm_atomic_state *state) if (!crtc_state->enable) continue; - ret = intel_modeset_pipe_config(crtc, state); + if (!needs_modeset(crtc_state)) { + ret = drm_atomic_add_affected_connectors(state, crtc); + if (ret) + return ret; + } + + ret = intel_modeset_pipe_config(crtc, + to_intel_crtc_state(crtc_state)); if (ret) return ret;