Received: by 10.213.65.68 with SMTP id h4csp291575imn; Tue, 13 Mar 2018 04:39:22 -0700 (PDT) X-Google-Smtp-Source: AG47ELsr3BMOHQ9VTvYv24d62fZTpcIW/eeAdFdMz1oOcdA6eIFVigd4dCNprcUUZDZ/GGXTT3my X-Received: by 10.99.94.197 with SMTP id s188mr211998pgb.363.1520941162519; Tue, 13 Mar 2018 04:39:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520941162; cv=none; d=google.com; s=arc-20160816; b=Und5NfQHNOBHVEXVG+Aqrkw//toVpfxaILIpnPGmG6/sSCc69wW6nDOJONY2peyaUS iAgJ+hC55bO3OOr/JbBW6oiLwgrQ0UoegX3/yWdVuQ8VDNoOJ/RMs80hzqdhav2YKCgJ Or0YJuCxoox6ATg/alY1LcqvU8Zrakih4e/n+KNEefUoWikLBlN6RKV0dDKsZ7Hao0nw aTEtEmtixKVFqY/fDaoohFXiE1TAqA7IUUIumR/ZNkohPT2zRRWHKXxjJZVlP5RTDkCE 5Wzb5U+QEF3J0C4R+uB4mW+Af3knhs4Xq8VdekxB3iImzVMtgT4kHg14Vw8TM2I5UgNF qPFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=iIcgdSo/HqxcGkz+e3xbYHbvljYl0ot2PDvs1Ej4eFg=; b=fe1lp6nwRwbkhE7mOJTfH9JUd/bfEyqLdT4+erBoLY13dzZwyK5quAhFBAh497rn6a HyCujjDqfRJX1ksn4FPG8mITY8RxPKhLST4Xnv322r2yWJ6h7xdxXa5oELdXLNMMaiHN Xh8R73CsKH61y5SQTECr797vObYg2BHLrdXcT8AKbgrkigaz1fdaN3A2QFzUsfD6G/jy 08G9sESfoHjIsOfKq4see0TEmFpD/HQlo8iaMOOc12Bpzqadxj/IJyqB9JmD7T6cZ1sf 1cVJ7AR7gvDIgbNwwbJTrFYyU5FGpqLa06LoWDrucDDlXPNpurSRqBB2Hsn+nKpJsUjH HbKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (no key for signature) header.i=@micronovasrl.com header.s=dkim header.b=P6dTbDNS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a4si6595pgq.56.2018.03.13.04.39.07; Tue, 13 Mar 2018 04:39:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=temperror (no key for signature) header.i=@micronovasrl.com header.s=dkim header.b=P6dTbDNS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933012AbeCMLht (ORCPT + 99 others); Tue, 13 Mar 2018 07:37:49 -0400 Received: from mail.micronovasrl.com ([212.103.203.10]:56506 "EHLO mail.micronovasrl.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932503AbeCMLhs (ORCPT ); Tue, 13 Mar 2018 07:37:48 -0400 Received: from mail.micronovasrl.com (mail.micronovasrl.com [127.0.0.1]) by mail.micronovasrl.com (Postfix) with ESMTP id D7707B006BC for ; Tue, 13 Mar 2018 12:37:46 +0100 (CET) Authentication-Results: mail.micronovasrl.com (amavisd-new); dkim=pass reason="pass (just generated, assumed good)" header.d=micronovasrl.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=micronovasrl.com; h=x-mailer:message-id:date:date:subject:subject:to:from:from; s=dkim; t=1520941066; x=1521805067; bh=5oAxgyaQdgi9fiqnU0xr/xsG 0jwZyOauUAXRYoKIHrk=; b=P6dTbDNSX+Q3XwKiE/1fhAo33wC66uqypkE3jYFO gtSQu05J6w7UtJjXdGlRoBHrpdxMtdciUxz8GxPlGGH+8zh3OYk2pthK+joqQm3E WRH0SS6QjnIs4jvX92C3IP4L1PQwkqme29YbGstSRFcRpQfpWVwfiHracOfXL4Ph 0Xc= X-Virus-Scanned: Debian amavisd-new at mail.micronovasrl.com X-Spam-Flag: NO X-Spam-Score: -2.9 X-Spam-Level: X-Spam-Status: No, score=-2.9 tagged_above=-10 required=4.5 tests=[ALL_TRUSTED=-1, BAYES_00=-1.9] autolearn=unavailable autolearn_force=no Received: from mail.micronovasrl.com ([127.0.0.1]) by mail.micronovasrl.com (mail.micronovasrl.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id MKsuxUSMi48z for ; Tue, 13 Mar 2018 12:37:46 +0100 (CET) Received: from localhost.localdomain (62-11-51-166.dialup.tiscali.it [62.11.51.166]) by mail.micronovasrl.com (Postfix) with ESMTPSA id 1CEE5B00430; Tue, 13 Mar 2018 12:37:45 +0100 (CET) From: Giulio Benetti To: Maxime Ripard Cc: David Airlie , Chen-Yu Tsai , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Giulio Benetti Subject: [PATCH v2] drm/sun4i: move rgb mode_valid from connector to encoder Date: Tue, 13 Mar 2018 12:36:57 +0100 Message-Id: <1520941017-81177-1-git-send-email-giulio.benetti@micronovasrl.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org mode_valid function must be connected to encoder. Otherwise it could get not be called by drm in the case there's a bridge connected to encoder instead of a panel. Move mode_valid function pointer to encoder helper functions, changing its prototype according to encoder helper function pointer. Signed-off-by: Giulio Benetti --- drivers/gpu/drm/sun4i/sun4i_rgb.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun4i_rgb.c b/drivers/gpu/drm/sun4i/sun4i_rgb.c index b8da5a5..f2fa1f2 100644 --- a/drivers/gpu/drm/sun4i/sun4i_rgb.c +++ b/drivers/gpu/drm/sun4i/sun4i_rgb.c @@ -52,10 +52,10 @@ static int sun4i_rgb_get_modes(struct drm_connector *connector) return drm_panel_get_modes(tcon->panel); } -static int sun4i_rgb_mode_valid(struct drm_connector *connector, - struct drm_display_mode *mode) +static enum drm_mode_status sun4i_rgb_mode_valid(struct drm_encoder *crtc, + const struct drm_display_mode *mode) { - struct sun4i_rgb *rgb = drm_connector_to_sun4i_rgb(connector); + struct sun4i_rgb *rgb = drm_encoder_to_sun4i_rgb(crtc); struct sun4i_tcon *tcon = rgb->tcon; u32 hsync = mode->hsync_end - mode->hsync_start; u32 vsync = mode->vsync_end - mode->vsync_start; @@ -108,7 +108,6 @@ static int sun4i_rgb_mode_valid(struct drm_connector *connector, static struct drm_connector_helper_funcs sun4i_rgb_con_helper_funcs = { .get_modes = sun4i_rgb_get_modes, - .mode_valid = sun4i_rgb_mode_valid, }; static void @@ -158,6 +157,7 @@ static void sun4i_rgb_encoder_disable(struct drm_encoder *encoder) static struct drm_encoder_helper_funcs sun4i_rgb_enc_helper_funcs = { .disable = sun4i_rgb_encoder_disable, .enable = sun4i_rgb_encoder_enable, + .mode_valid = sun4i_rgb_mode_valid, }; static void sun4i_rgb_enc_destroy(struct drm_encoder *encoder) -- 2.7.4