From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3CA30C35671 for ; Sat, 22 Feb 2020 21:27:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 13764206EF for ; Sat, 22 Feb 2020 21:27:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726943AbgBVV1T (ORCPT ); Sat, 22 Feb 2020 16:27:19 -0500 Received: from asavdk3.altibox.net ([109.247.116.14]:39562 "EHLO asavdk3.altibox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726828AbgBVV1T (ORCPT ); Sat, 22 Feb 2020 16:27:19 -0500 Received: from ravnborg.org (unknown [158.248.194.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by asavdk3.altibox.net (Postfix) with ESMTPS id B446120095; Sat, 22 Feb 2020 22:27:14 +0100 (CET) Date: Sat, 22 Feb 2020 22:27:13 +0100 From: Sam Ravnborg To: tang pengchuan Cc: David Airlie , Daniel Vetter , robh+dt@kernel.org, mark.rutland@arm.com, Orson Zhai , ML dri-devel , "Linux-Kernel@Vger. Kernel. Org" , Chunyan Zhang , Baolin Wang Subject: Re: [PATCH RFC v3 2/6] drm/sprd: add Unisoc's drm kms master Message-ID: <20200222212713.GA30872@ravnborg.org> References: <1582271336-3708-1-git-send-email-kevin3.tang@gmail.com> <1582271336-3708-3-git-send-email-kevin3.tang@gmail.com> <20200221213652.GD3456@ravnborg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-CMAE-Score: 0 X-CMAE-Analysis: v=2.3 cv=eMA9ckh1 c=1 sm=1 tr=0 a=UWs3HLbX/2nnQ3s7vZ42gw==:117 a=UWs3HLbX/2nnQ3s7vZ42gw==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=GLTfEzBshYVTt7jvnNEA:9 a=CjuIK1q_8ugA:10 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Kevin/tang. Thanks for the quick and detailed feedback. Your questions are addressed below. Sam > > > +static int sprd_drm_bind(struct device *dev) > > > +{ > > > + struct drm_device *drm; > > > + struct sprd_drm *sprd; > > > + int err; > > > + > > > + drm = drm_dev_alloc(&sprd_drm_drv, dev); > > > + if (IS_ERR(drm)) > > > + return PTR_ERR(drm); > > You should embed drm_device in struct sprd_drm. > > See example code in drm/drm_drv.c > > > > This is what modern drm drivers do. > > > > I *think* you can drop the component framework if you do this. > > > I have read it(drm/drm_drv.c) carefully, if drop the component framework, > the whole our drm driver maybe need to redesign, so i still want to keep > current design. OK, fine. > > > + sprd_drm_mode_config_init(drm); > > > + > > > + /* bind and init sub drivers */ > > > + err = component_bind_all(drm->dev, drm); > > > + if (err) { > > > + DRM_ERROR("failed to bind all component.\n"); > > > + goto err_dc_cleanup; > > > + } > > When you have a drm_device - which you do here. > > Then please use drm_err() and friends for error messages. > > Please verify all uses of DRM_XXX > > > modern drm drivers need drm_xxx to replace DRM_XXX? Yes, use of DRM_XXX is deprecated - when you have a drm_device. > > > > > + /* with irq_enabled = true, we can use the vblank feature. */ > > > + drm->irq_enabled = true; > > I cannot see any irq being installed. This looks wrong. > > > Our display controller isr is been register on crtc driver(sprd_dpu.c), not > here. I think you just need to move this to next patch and then it is fine. Sam