From patchwork Thu May 14 01:17:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 11547679 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D171F618 for ; Thu, 14 May 2020 01:17:36 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B15BE205ED for ; Thu, 14 May 2020 01:17:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="k7sStJd2" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B15BE205ED Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BE30F6E2A3; Thu, 14 May 2020 01:17:28 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by gabe.freedesktop.org (Postfix) with ESMTPS id DED5D6E2A0 for ; Thu, 14 May 2020 01:17:26 +0000 (UTC) Received: from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi [81.175.216.236]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 201C99A8; Thu, 14 May 2020 03:17:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1589419044; bh=n7hlmyzD/bevl4wx8zqkO9jjvgYiwmG6A/5T3iD80pw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=k7sStJd29aEnT7uzorbfcMEow1MJlG7AwwU5tju3clHtGQyUOAUcvBLaMxtZ0/Nsn PisbHqSNtdsM+0ccgG6htDcQIPvmJrt96qF5DJNGQS1Y1QZtS76SrSzJt8KMHrYWcR zc6QciqtM86Q39W+EAC7NRWX4bmzckmDRPCHhy7Y= From: Laurent Pinchart To: dri-devel@lists.freedesktop.org Subject: [PATCH 2/2] drm: meson: dw-hdmi: Use dw_hdmi context to replace hack Date: Thu, 14 May 2020 04:17:07 +0300 Message-Id: <20200514011707.6512-2-laurent.pinchart+renesas@ideasonboard.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200514011707.6512-1-laurent.pinchart+renesas@ideasonboard.com> References: <20200514011707.6512-1-laurent.pinchart+renesas@ideasonboard.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jernej Skrabec , Jonas Karlman , Neil Armstrong , Sandy Huang , linux-renesas-soc@vger.kernel.org, Chen-Yu Tsai Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The meson-dw-hdmi driver needs to access its own context from the .mode_valid() operation. It currently gets it from the dev_private field of the drm_device retrieved from the connector, which is a hack. Use the dw_hdmi context passed to the .mode_valid() operation instead. Signed-off-by: Laurent Pinchart --- drivers/gpu/drm/meson/meson_dw_hdmi.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/meson/meson_dw_hdmi.c b/drivers/gpu/drm/meson/meson_dw_hdmi.c index 174d45ecdeda..808e73fe8b3e 100644 --- a/drivers/gpu/drm/meson/meson_dw_hdmi.c +++ b/drivers/gpu/drm/meson/meson_dw_hdmi.c @@ -634,7 +634,9 @@ dw_hdmi_mode_valid(struct dw_hdmi *hdmi, struct drm_connector *connector, const struct drm_display_mode *mode) { - struct meson_drm *priv = connector->dev->dev_private; + struct device *dev = dw_hdmi_device(hdmi); + struct meson_dw_hdmi *dw_hdmi = dev_get_drvdata(dev); + struct meson_drm *priv = dw_hdmi->priv; bool is_hdmi2_sink = connector->display_info.hdmi.scdc.supported; unsigned int phy_freq; unsigned int vclk_freq; @@ -693,7 +695,7 @@ dw_hdmi_mode_valid(struct dw_hdmi *hdmi, if (mode->flags & DRM_MODE_FLAG_DBLCLK) venc_freq /= 2; - dev_dbg(connector->dev->dev, "%s: vclk:%d phy=%d venc=%d hdmi=%d\n", + dev_dbg(dev, "%s: vclk:%d phy=%d venc=%d hdmi=%d\n", __func__, phy_freq, vclk_freq, venc_freq, hdmi_freq); return meson_vclk_vic_supported_freq(priv, phy_freq, vclk_freq);