Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754465AbcK3GnL (ORCPT ); Wed, 30 Nov 2016 01:43:11 -0500 Received: from mail-io0-f181.google.com ([209.85.223.181]:34008 "EHLO mail-io0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752526AbcK3GnB (ORCPT ); Wed, 30 Nov 2016 01:43:01 -0500 MIME-Version: 1.0 In-Reply-To: <1480070076-6196-3-git-send-email-yt.shen@mediatek.com> References: <1480070076-6196-1-git-send-email-yt.shen@mediatek.com> <1480070076-6196-3-git-send-email-yt.shen@mediatek.com> From: Daniel Kurtz Date: Wed, 30 Nov 2016 14:42:39 +0800 X-Google-Sender-Auth: URowwVHvDKxx_SG9Qrb1paw01Lk Message-ID: Subject: Re: [PATCH v10 02/13] drm/mediatek: add *driver_data for different hardware settings To: YT Shen Cc: dri-devel , Philipp Zabel , David Airlie , Matthias Brugger , Mao Huang , CK Hu , Bibby Hsieh , Daniel Vetter , Thierry Reding , Jie Qiu , Maxime Ripard , Chris Wilson , shaoming chen , Jitao Shi , Boris Brezillon , Dan Carpenter , "linux-arm-kernel@lists.infradead.org" , "moderated list:ARM/Mediatek SoC support" , "linux-kernel@vger.kernel.org" , srv_heupstream , Sascha Hauer , =?UTF-8?B?WWluZ2pvZSBDaGVuICjpmbPoi7HmtLIp?= , Emil Velikov Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1659 Lines: 53 Hi YT, On Fri, Nov 25, 2016 at 6:34 PM, YT Shen wrote: > > There are some hardware settings changed, between MT8173 & MT2701: > DISP_OVL address offset changed, color format definition changed. > DISP_RDMA fifo size changed. > DISP_COLOR offset changed. > MIPI_TX pll setting changed. > And add prefix for mtk_ddp_main & mtk_ddp_ext & mutex_mod. Sorry, I have not had time to thoroughly review the new patch set, but one quick comment: > diff --git a/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h b/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h > index 22a33ee..cfaa760 100644 > --- a/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h > +++ b/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h > @@ -78,6 +78,10 @@ struct mtk_ddp_comp_funcs { > struct drm_crtc_state *state); > }; > > +struct mtk_ddp_comp_driver_data { > + unsigned int color_offset; > +}; > + > struct mtk_ddp_comp { > struct clk *clk; > void __iomem *regs; > @@ -85,6 +89,7 @@ struct mtk_ddp_comp { > struct device *larb_dev; > enum mtk_ddp_comp_id id; > const struct mtk_ddp_comp_funcs *funcs; > + const struct mtk_ddp_comp_driver_data *data; I want to avoid adding this generic pointer here to all mtk_ddp_comp, since this is only used by the color component. Instead, define color specific types: struct mtk_disp_color_data { unsigned int offset; }; struct mtk_disp_color { struct mtk_ddp_comp ddp_comp; const struct mtk_disp_color_data *data; }; Then, add another comp_type check and fetch the dev data in mtk_drm_probe() or maybe mtk_ddp_comp_init(). -Dan