From patchwork Fri Mar 10 04:32:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 9614751 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 A3001604DD for ; Fri, 10 Mar 2017 04:47:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 951EC286B9 for ; Fri, 10 Mar 2017 04:47:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 89FA2286C0; Fri, 10 Mar 2017 04:47:30 +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=unavailable 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 56C1E286C0 for ; Fri, 10 Mar 2017 04:47:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A40B86ED92; Fri, 10 Mar 2017 04:47:26 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qk0-x22d.google.com (mail-qk0-x22d.google.com [IPv6:2607:f8b0:400d:c09::22d]) by gabe.freedesktop.org (Postfix) with ESMTPS id 239E06ED8F for ; Fri, 10 Mar 2017 04:47:02 +0000 (UTC) Received: by mail-qk0-x22d.google.com with SMTP id v125so149097972qkh.2 for ; Thu, 09 Mar 2017 20:47:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=aLeFIwLbdbwwdbD3yDhcV5K4Ms1Nq0VVix43CouRp5Q=; b=KB7SQNjH3spBJ+wQrXcKRz3L0SG5QRdSZpHNKvSV8elTiH7q/IN3x/MZN5qfCt9GiC 4MRYNLfqO7fBgO9uQ7cTCVV1GQhrzuzch1WJb2Ai6EVH2dNEIeI9g7PN2FH0JVwivZMQ PJ5e6rj/2ntMoLTuHgdUO3/hYf9+13vJOa6Bo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=aLeFIwLbdbwwdbD3yDhcV5K4Ms1Nq0VVix43CouRp5Q=; b=DpTPfCt8LwIiV1YJkE3UE5l79eej+2QnesinGUfHKyq+QkGSEkxAW3h2J3wf/2AgIL f3HsVsWMKn9JsHy02vyKbbCL/nMiw12aFQ4vwyfUaTo8TTNoOkRd7emk/5LXq6lH084K OpPNcdlRmRG9yzmq+B7JwC/8aCi8e5nstLzMP0q2DfIQqmo3XjR7r5RFKWKkw8bLm0gX 82EucPFZoO0Yu0gmbuksyyRcrMU4T6R+5xFHsmy0+aX14HUDX/gptzvdAQ6KgBXNrYUM jZnFXTOyX0qdFMSduFdTTryUd6IrfzgASCC0yunOIBmh8/9cw3CkwVRwZ3WS07VUZ57o 3pnw== X-Gm-Message-State: AFeK/H186GDs+LOvqw2aeiM/Z1WhIzrS4GvOL9xYb/8/RrCqdCzYIuY9OuUGPrh4deAWxNjr X-Received: by 10.55.198.76 with SMTP id b73mr18586664qkj.54.1489120629078; Thu, 09 Mar 2017 20:37:09 -0800 (PST) Received: from boxwood.roam.corp.google.com (cpe-75-189-128-87.nc.res.rr.com. [75.189.128.87]) by smtp.gmail.com with ESMTPSA id n19sm5697731qtn.35.2017.03.09.20.37.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 09 Mar 2017 20:37:07 -0800 (PST) From: Sean Paul To: linux-rockchip@lists.infradead.org, dri-devel@lists.freedesktop.org Subject: [PATCH 15/41] drm/bridge: analogix_dp: Move enable video into config_video() Date: Thu, 9 Mar 2017 23:32:30 -0500 Message-Id: <20170310043305.17216-16-seanpaul@chromium.org> X-Mailer: git-send-email 2.12.0.246.ga2ecc84866-goog In-Reply-To: <20170310043305.17216-1-seanpaul@chromium.org> References: <20170310043305.17216-1-seanpaul@chromium.org> MIME-Version: 1.0 Cc: =?UTF-8?q?=E5=BE=81=E5=A2=9E=20=E7=8E=8B?= , Lin Huang , Tomeu Vizoso , Douglas Anderson , Yakir Yang , =?UTF-8?q?St=C3=A9phane=20Marchesin?= 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Lin Huang We need to enable video before analogix_dp_is_video_stream_on(), so we can get the right video stream status. Cc: 征增 王 Cc: Stéphane Marchesin Signed-off-by: Lin Huang Signed-off-by: Sean Paul Reviewed-by: Andrzej Hajda --- drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c index 9dfa1b507389..52218d743059 100644 --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c @@ -823,11 +823,10 @@ static int analogix_dp_config_video(struct analogix_dp_device *dp) if (analogix_dp_is_slave_video_stream_clock_on(dp) == 0) break; if (timeout_loop > DP_TIMEOUT_LOOP_COUNT) { - dev_err(dp->dev, "Timeout of video streamclk ok\n"); + dev_err(dp->dev, "Timeout of slave video streamclk ok\n"); return -ETIMEDOUT; } - - usleep_range(1, 2); + usleep_range(1000, 1001); } /* Set to use the register calculated M/N video */ @@ -842,6 +841,9 @@ static int analogix_dp_config_video(struct analogix_dp_device *dp) /* Configure video slave mode */ analogix_dp_enable_video_master(dp, 0); + /* Enable video */ + analogix_dp_start_video(dp); + timeout_loop = 0; for (;;) { @@ -955,9 +957,6 @@ static void analogix_dp_commit(struct analogix_dp_device *dp) DRM_ERROR("failed to enable the panel\n"); } - /* Enable video */ - analogix_dp_start_video(dp); - dp->psr_enable = analogix_dp_detect_sink_psr(dp); if (dp->psr_enable) analogix_dp_enable_sink_psr(dp);