From patchwork Mon Jun 17 20:12:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 11000415 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A439C14DB for ; Mon, 17 Jun 2019 20:13:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 97DF32887E for ; Mon, 17 Jun 2019 20:13:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8C964289D2; Mon, 17 Jun 2019 20:13:46 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED 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 328E7289FC for ; Mon, 17 Jun 2019 20:13:46 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0C2916E0A0; Mon, 17 Jun 2019 20:13:45 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qt1-x842.google.com (mail-qt1-x842.google.com [IPv6:2607:f8b0:4864:20::842]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4BB6F6E0A0 for ; Mon, 17 Jun 2019 20:13:43 +0000 (UTC) Received: by mail-qt1-x842.google.com with SMTP id x47so12364184qtk.11 for ; Mon, 17 Jun 2019 13:13:43 -0700 (PDT) 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=q0IYZw+KH0ep1U9uj+KlMGqWaqwAhViNoXO4Kfh8beQ=; b=gkD4/Zs/7DEC8pQdEE373jzdGFcxEtTUVOzkysr9tlMidRC6BAQBiF+Es/OjLkuirV s1LYgRa8hs/LOUcfuvAU18RtHE+qZVtRKViXwNx8xtupiYBxV13gDlggF3/fxLZ+wGxD de9U/eA9sRDROrnboBA5MxwpKzFSwrawp/qh23/RlYU9DjqRUjW7BQulqDV2Z+zbfpl4 RfwZZK2tHuW5EWxUuJzYdIHmSHFRVucSjVd76DbNsjDlQgLkgH8qSV9fh/haOGUwspqU e2azU8pGN60AMHocC6+MjlZcAIvdiXH3gvtXJpRn3QFec3P7CpgNVytUn46MaJZVCCJZ z9IQ== X-Gm-Message-State: APjAAAUmo9Yahaj1MlGqpGYGKd/LrSWHJ6qxydqnf2ILUjwMMakgzxbA znTsWketw3Sbkd5mpJlcBzX6zPw/TFI= X-Google-Smtp-Source: APXvYqy+jk+BfnzTYGY88EaSeelKmL4/FugRI08hWufUcxI6WAllfyoDpbco0gKpGs4EEpE6pKrO7w== X-Received: by 2002:ac8:38cc:: with SMTP id g12mr95183704qtc.68.1560802421456; Mon, 17 Jun 2019 13:13:41 -0700 (PDT) Received: from rosewood.cam.corp.google.com ([100.100.175.19]) by smtp.gmail.com with ESMTPSA id r36sm7071563qte.71.2019.06.17.13.13.40 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 17 Jun 2019 13:13:41 -0700 (PDT) From: Sean Paul To: dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org Subject: [PATCH 11/13] drm/msm/dsi: Use the new setup_encoder function in attach_dsi_device Date: Mon, 17 Jun 2019 16:12:56 -0400 Message-Id: <20190617201301.133275-8-sean@poorly.run> X-Mailer: git-send-email 2.22.0.410.gd8fdbe21b5-goog In-Reply-To: <20190617201301.133275-1-sean@poorly.run> References: <20190617200405.131843-1-sean@poorly.run> <20190617201301.133275-1-sean@poorly.run> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poorly.run; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=q0IYZw+KH0ep1U9uj+KlMGqWaqwAhViNoXO4Kfh8beQ=; b=G4uJYUFMtcTefXKAlRErNW0ANUVg7YuNxp3waBaDItU+/XvEaV64v4+HFc2q+inCPu xE+BYJqIBaR8N6IPnstD/HwIDz3kEz+PGZOZUTK7NVsYpnv01Sdt8dxT/nFA/0w+tm80 M3BB/yHh3FDEgkY9tBCoAsv0OGnJQ2F/vOLi/o3QNLIeVOHQmr0IULbOeswl7BYilBKP FeGeAdr2AJCJsFqIFX30M9KVLqIjBrlv7EGO+Yt6C0ACEdqKzaUlujqjqasfrJoFH5HD 2w7yHGRDMNBK0Mhc6jQiSjwyZZ6+Qo10xAuHU0tj3V27OaLX5klFzpt5DYVFC8NVp+La Yqog== X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , linux-arm-msm@vger.kernel.org, Sean Paul , Sean Paul Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Sean Paul Now that we have a function to call set_encoder_mode() for us, use it. Signed-off-by: Sean Paul --- drivers/gpu/drm/msm/dsi/dsi.h | 2 +- drivers/gpu/drm/msm/dsi/dsi_host.c | 2 +- drivers/gpu/drm/msm/dsi/dsi_manager.c | 15 ++------------- 3 files changed, 4 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/msm/dsi/dsi.h b/drivers/gpu/drm/msm/dsi/dsi.h index e0bbe8128aef..f8a611725f2e 100644 --- a/drivers/gpu/drm/msm/dsi/dsi.h +++ b/drivers/gpu/drm/msm/dsi/dsi.h @@ -96,7 +96,7 @@ struct drm_connector *msm_dsi_manager_connector_init(u8 id); struct drm_connector *msm_dsi_manager_ext_bridge_init(u8 id); int msm_dsi_manager_cmd_xfer(int id, const struct mipi_dsi_msg *msg); bool msm_dsi_manager_cmd_xfer_trigger(int id, u32 dma_base, u32 len); -void msm_dsi_manager_attach_dsi_device(int id, u32 device_flags); +void msm_dsi_manager_attach_dsi_device(int id); int msm_dsi_manager_register(struct msm_dsi *msm_dsi); void msm_dsi_manager_unregister(struct msm_dsi *msm_dsi); bool msm_dsi_manager_validate_current_config(u8 id); diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c index daa08a033b59..effea0db5626 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_host.c +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c @@ -1598,7 +1598,7 @@ static int dsi_host_attach(struct mipi_dsi_host *host, msm_host->format = dsi->format; msm_host->mode_flags = dsi->mode_flags; - msm_dsi_manager_attach_dsi_device(msm_host->id, dsi->mode_flags); + msm_dsi_manager_attach_dsi_device(msm_host->id); /* Some gpios defined in panel DT need to be controlled by host */ ret = dsi_host_init_panel_gpios(msm_host, &dsi->dev); diff --git a/drivers/gpu/drm/msm/dsi/dsi_manager.c b/drivers/gpu/drm/msm/dsi/dsi_manager.c index 1ee3197a9bdd..602953b90cab 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_manager.c +++ b/drivers/gpu/drm/msm/dsi/dsi_manager.c @@ -787,14 +787,10 @@ bool msm_dsi_manager_cmd_xfer_trigger(int id, u32 dma_base, u32 len) return true; } -void msm_dsi_manager_attach_dsi_device(int id, u32 device_flags) +void msm_dsi_manager_attach_dsi_device(int id) { struct msm_dsi *msm_dsi = dsi_mgr_get_dsi(id); struct drm_device *dev = msm_dsi->dev; - struct msm_drm_private *priv; - struct msm_kms *kms; - struct drm_encoder *encoder; - bool cmd_mode; /* * drm_device pointer is assigned to msm_dsi only in the modeset_init @@ -806,14 +802,7 @@ void msm_dsi_manager_attach_dsi_device(int id, u32 device_flags) if (!dev) return; - priv = dev->dev_private; - kms = priv->kms; - encoder = msm_dsi_get_encoder(msm_dsi); - cmd_mode = !(device_flags & - MIPI_DSI_MODE_VIDEO); - - if (encoder && kms->funcs->set_encoder_mode) - kms->funcs->set_encoder_mode(kms, encoder, cmd_mode); + msm_dsi_manager_setup_encoder(id); } int msm_dsi_manager_register(struct msm_dsi *msm_dsi)