From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754858AbcH3PVv (ORCPT ); Tue, 30 Aug 2016 11:21:51 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:36361 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751590AbcH3PVu (ORCPT ); Tue, 30 Aug 2016 11:21:50 -0400 MIME-Version: 1.0 In-Reply-To: <20160830065500.31847-1-net147@gmail.com> References: <20160830065500.31847-1-net147@gmail.com> From: Emil Velikov Date: Tue, 30 Aug 2016 16:21:47 +0100 Message-ID: Subject: Re: [PATCH] drm/sun4i: rgb: add missing calls to drm_panel_{prepare, unprepare} To: Jonathan Liu Cc: Maxime Ripard , linux-sunxi@googlegroups.com, ML dri-devel , "Linux-Kernel@Vger. Kernel. Org" , Chen-Yu Tsai , LAKML Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 30 August 2016 at 07:55, Jonathan Liu wrote: > If the enable-gpios property of a simple panel in device tree is set, > the GPIO is not toggled on/off because of missing calls to > drm_panel_prepare and drm_panel_unprepare. > > Signed-off-by: Jonathan Liu > --- > drivers/gpu/drm/sun4i/sun4i_rgb.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/gpu/drm/sun4i/sun4i_rgb.c b/drivers/gpu/drm/sun4i/sun4i_rgb.c > index f5bbac6..d6943e9 100644 > --- a/drivers/gpu/drm/sun4i/sun4i_rgb.c > +++ b/drivers/gpu/drm/sun4i/sun4i_rgb.c > @@ -151,6 +151,7 @@ static void sun4i_rgb_encoder_enable(struct drm_encoder *encoder) > > DRM_DEBUG_DRIVER("Enabling RGB output\n"); > > + drm_panel_prepare(tcon->panel); > drm_panel_enable(tcon->panel); IMHO it's worth having a _prepare_enable, and alike on the dtor side, similar to clk. The clk helper attributes when .enable() fails, which is a good idea. Looking on the drm side - all the users of such helper(s) don't bother checking neither .prepare or .enable. So updating that alongside the introduction would be a great move ;-) Just an idea about another small task. Emil P.S. Skimming through v4.7 mediatek (mtk) driver looks a bit assymetrical wrt using the drm_panel API. Worth checking if things have improved with later versions ?