From patchwork Tue Oct 23 18:23:35 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 1632231 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id 73122DF283 for ; Tue, 23 Oct 2012 19:35:28 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 637129F73A for ; Tue, 23 Oct 2012 12:35:28 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-we0-f177.google.com (mail-we0-f177.google.com [74.125.82.177]) by gabe.freedesktop.org (Postfix) with ESMTP id 914F99F738 for ; Tue, 23 Oct 2012 12:32:00 -0700 (PDT) Received: by mail-we0-f177.google.com with SMTP id u50so2216072wey.36 for ; Tue, 23 Oct 2012 12:32:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=p97InMY2tmzm1+X0gubW8wzO+831IMGfcO35UO+sIOk=; b=ekQZYoLOOZ6GCcT6FbxCfJRId1XRGCc+dv2Ufz3ZMY5G9HxHhxwfGSeVcfTe5nY/gy Az4KZO4DBcXfS2ORRdxFczkY6ya77pPWb3vsIdec4lJjO69R64RBlurwG1uaBpPOOWkR HJ4WIUmTdFOw2TErs/JKNRo6rDHDb3OdOYdLs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=p97InMY2tmzm1+X0gubW8wzO+831IMGfcO35UO+sIOk=; b=Hbqam6ZnV64SrO6am0lm8oAxHaw6VnXLbsSXVz/leRQ22dIbNW4ldj2Ly07EY7Jtbw K5kwgxoQxwIQnr2GqXjqJbh5gRo+/ldKu9b9qZhVITmGdP3Ln9bleVFDspL9EXO4ZIe+ RaKiccwYaInUp87gJda6Xn2dNGQywAyZh5RIT0Wfb+fRHGrpbaDNeeDht+6R5do7dGvg YFMDKtOFeCCiB+QgCzZgDG5JN+P23UPBlZ88W3sJKspSFEjPH8xEn1oF2B1qdOfbJw1e 1RBjWZHJ79FediepAO3XaOKc/eoMw4xsyV7fa/pylIds5ZlDVrzFKUxCpiw+LLmHIu4y 5VHA== Received: by 10.216.199.30 with SMTP id w30mr7644365wen.25.1351020720181; Tue, 23 Oct 2012 12:32:00 -0700 (PDT) Received: from wespe.ffwll.local (178-83-130-250.dynamic.hispeed.ch. [178.83.130.250]) by mx.google.com with ESMTPS id di7sm312800wib.11.2012.10.23.12.31.59 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 23 Oct 2012 12:31:59 -0700 (PDT) From: Daniel Vetter To: DRI Development Subject: [PATCH 4/7] drm: properly init/reset connector status Date: Tue, 23 Oct 2012 20:23:35 +0200 Message-Id: <1351016618-2752-5-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1351016618-2752-1-git-send-email-daniel.vetter@ffwll.ch> References: <1351016618-2752-1-git-send-email-daniel.vetter@ffwll.ch> X-Gm-Message-State: ALoCoQlB7PklN0GXvsJDV04eIBjg0g5m4i2YH+ExAFHc4Dgz30g9uwPmglp6bpmAuKThCWitrTFk Cc: Daniel Vetter X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org This can help drivers to make somewhat intelligent decisions in their ->detect callback: If the connector is hpd capable and in the unknown state, the driver needs to force a full detect cycle. Otherwise it could just (if it chooses so) to update the connector state from it's hpd handler directly, and always return that in the ->detect callback. Atm only drm/i915 calls drm_mode_config_reset at resume time, so other drivers would need to add that call first before using this facility. Signed-Off-by: Daniel Vetter --- drivers/gpu/drm/drm_crtc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index ef1b221..05c4e7b 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c @@ -555,6 +555,7 @@ int drm_connector_init(struct drm_device *dev, INIT_LIST_HEAD(&connector->probed_modes); INIT_LIST_HEAD(&connector->modes); connector->edid_blob_ptr = NULL; + connector->status = connector_status_unknown; list_add_tail(&connector->head, &dev->mode_config.connector_list); dev->mode_config.num_connector++; @@ -3656,9 +3657,12 @@ void drm_mode_config_reset(struct drm_device *dev) if (encoder->funcs->reset) encoder->funcs->reset(encoder); - list_for_each_entry(connector, &dev->mode_config.connector_list, head) + list_for_each_entry(connector, &dev->mode_config.connector_list, head) { + connector->status = connector_status_unknown; + if (connector->funcs->reset) connector->funcs->reset(connector); + } } EXPORT_SYMBOL(drm_mode_config_reset);