Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp726051ybv; Sat, 22 Feb 2020 13:29:43 -0800 (PST) X-Google-Smtp-Source: APXvYqyRyr+fAVjqtWIh+fIGSwW+Eb13ELYNd+Eau+lkKeaDGHLxCBnJCDBd9G0W636FHq2AfzTM X-Received: by 2002:a9d:6e8f:: with SMTP id a15mr1841515otr.178.1582406983792; Sat, 22 Feb 2020 13:29:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582406983; cv=none; d=google.com; s=arc-20160816; b=jxDmHm0Kv5043g4SlpJfNvpoh3fWfVy3y6yo04nrkTUQa4WBhuxWow9UdYWjdhQSPo N2kSrgh6OzYzScOkiXWDllTg/13Qs2DeRx7V57FXgyXO+42tRnH4ckTi5dVcgSfxF0Lj jFrv8gRT+6k10wfeEAEifOn8DVdTRuy3IKl9xJYBEfvC0a+RyzqvMPxWs2dDMhJVVS00 JApyt1TlmbAxVexdm7gPH5jskqaeOBMvzdBoqmF76p1Q6esgAiShUt+yzUprXTBJySvF GGRr2kzGG+fqFhC0pRU0axSaTD8DgYX9AnpM5BkYZStTdTG1jRxxvyMiG7ouqtrPXqSo p/Rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=LGoYGdJ0JJnIluaG3/2T5tAXG96mX4n19hdbiceakJM=; b=k6Qu+lp55UBgdUtyj3kUFrmAYOe1yZiWCxRshYkl+cIXekMzUjmOazcVZCkCX5M4mg N2jtlWhEt47bXSH9PszEhz4OpqWRvGTvEZAOPa8BeGe3dQrCvXnRgTdnf/0AVfLHlVD5 YhSTovN3dBduzllgPORzIJ4QsBUg9Guc1ryGn3DGEwiJAHhzcVMwol+W3lNyxeoev2CN WCh3Z3ffk1uKih4Xfu7lYIKVb0i5KgdZdy7DzeVtcXAUi0HMI9Dokh5jsHsOtE/VUCNr WlHq3TgBlRd2Z2UWfrxxLi/HfHv0ma/Con7aLc0ElnIM74Fi2zRxgYTOTOrNP/pRddk5 FOxA== ARC-Authentication-Results: i=1; mx.google.com; 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 t130si2740103oib.202.2020.02.22.13.29.31; Sat, 22 Feb 2020 13:29:43 -0800 (PST) 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; 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 S1726923AbgBVV1T (ORCPT + 99 others); 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