From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1426061AbdD1Nrp (ORCPT ); Fri, 28 Apr 2017 09:47:45 -0400 Received: from us01smtprelay-2.synopsys.com ([198.182.60.111]:60822 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161076AbdD1Nri (ORCPT ); Fri, 28 Apr 2017 09:47:38 -0400 From: Jose Abreu To: dri-devel@lists.freedesktop.org Cc: linux-kernel@vger.kernel.org, Jose Abreu , Carlos Palminha , Alexey Brodkin , =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= , Daniel Vetter , Dave Airlie , Andrzej Hajda Subject: [PATCH v2 0/2] Introduce crtc->mode_valid() callback Date: Fri, 28 Apr 2017 14:47:10 +0100 Message-Id: X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patchset introduces a new callback for crtc, called mode_valid() that is responsible to limit the number of probbed modes. Just like connector->mode_valid(), this new callback is called at mode probbing stage so that we can validate the mode. This is specially useful because arcpgu crtc is responsible to set a clock value in the commit() stage but unfortunatelly this clock does not support all the needed ranges. This way we can restrict the number of modes that are handed to userspace, so that we dont hand a mode that will fail the commit() stage. I guess this can also happen for other drivers so we introduce the callback in the core. The behaviour remains the same for crtcs that don't have the callback. Also, for a given set of crtcs that can be bound to the connector, if at least one can display the mode then the mode will be probbed. For more info about why this is needed in arcpgu, please refer here [1]. [1] https://patchwork.kernel.org/patch/9694177/ Jose Abreu (2): drm: Introduce crtc->mode_valid() callback drm: arcpgu: Use crtc->mode_valid() callback Cc: Carlos Palminha Cc: Alexey Brodkin Cc: Ville Syrjälä Cc: Daniel Vetter Cc: Dave Airlie Cc: Andrzej Hajda drivers/gpu/drm/arc/arcpgu_crtc.c | 28 ++++++++++++++++-- drivers/gpu/drm/drm_probe_helper.c | 50 ++++++++++++++++++++++++++++++-- include/drm/drm_modeset_helper_vtables.h | 26 +++++++++++++++++ 3 files changed, 99 insertions(+), 5 deletions(-) -- 1.9.1