Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp1379288pxa; Fri, 28 Aug 2020 11:00:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzc9Mm3QjIcuxdlWY3Xcuu+FPbrcoP0nNxoR2SS1aoF46/eL0oHrAfSrVdMyFg0q1z0yzoY X-Received: by 2002:a17:907:206a:: with SMTP id qp10mr3195820ejb.497.1598637618699; Fri, 28 Aug 2020 11:00:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598637618; cv=none; d=google.com; s=arc-20160816; b=0EZvuNcmc6h/ARzdMqu6ysseE44y15DJwCaOJ1hqToy5TYRdwC2SbO8zKxu8FzoudS Kf3EVqOb4N1fbXwS6t/WwtzZsHVKu6SyY7guG+Mw/KoOqNC21Ler6gdTi3CEBe/dvrBn 6CQl3rl251BrQlHRV40ObtlkmW1ej+/DloEnqtcnpYKfLnlStsS3RlSmG8opwpGAKh1L XNTQV/zD4reQXreloE5xL7CaiXew7seu8iKW1dXmNnW0sP/hOKaZXL/s4z5AZ8xU0u6/ AmmuwzaDBfIyo0T6jRfg2ON4Q3TIsnBhmZm1y9f4fHIcoa09C1pFovD4SLFB4aqG8kfJ XWyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=dohxOvwEMCj6e6QR0CAHxp7Q2WwLYAFWhfoLLtyh6bY=; b=IW/TpSWyl4ku5pSZM+u03pS8mhsIqoIfr0n7dd0hKlmCAS1C8yNPsH/nGsxmXdDJNW 4Khz5uadqR9ceiNEf7Ea5hGqAor3E2zOkTU3rEJom9xEQd6yvVcSob64hfekFpUmkf60 R6a8O7h114hm6mK6KIK5GXoyORb5GOw54it/nARfuXDYcGrqE0Jo4D/nC4nA58da9Kwr ydxbdu6qLbjl9N3LX5jnDW58UhmXRaPNPKjssNp35sbVFitTU8onMP8BQcVg4bcqqs9Z wcBN9T5KIH4+et/pBpxDIzzapdNG8ua0haJbbyPGiQdnWj4fAwZ3sD5US6lPDvPJ65qz hQPA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qk7si157170ejb.23.2020.08.28.10.59.53; Fri, 28 Aug 2020 11:00:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727824AbgH1R4h (ORCPT + 99 others); Fri, 28 Aug 2020 13:56:37 -0400 Received: from asavdk3.altibox.net ([109.247.116.14]:46838 "EHLO asavdk3.altibox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726677AbgH1R4g (ORCPT ); Fri, 28 Aug 2020 13:56:36 -0400 Received: from ravnborg.org (unknown [188.228.123.71]) (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 A12C6201C5; Fri, 28 Aug 2020 19:55:50 +0200 (CEST) Date: Fri, 28 Aug 2020 19:55:48 +0200 From: Sam Ravnborg To: Kevin Tang Cc: Maarten Lankhorst , Maxime Ripard , Sean Paul , David Airlie , Daniel Vetter , Rob Herring , Mark Rutland , Orson Zhai , "Linux-Kernel@Vger. Kernel. Org" , ML dri-devel , Chunyan Zhang Subject: Re: [PATCH RFC v6 2/6] drm/sprd: add Unisoc's drm kms master Message-ID: <20200828175548.GA660103@ravnborg.org> References: <1595930879-2478-1-git-send-email-kevin3.tang@gmail.com> <1595930879-2478-3-git-send-email-kevin3.tang@gmail.com> <20200728204532.GC1277651@ravnborg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-CMAE-Score: 0 X-CMAE-Analysis: v=2.3 cv=CaYmGojl c=1 sm=1 tr=0 a=S6zTFyMACwkrwXSdXUNehg==:117 a=S6zTFyMACwkrwXSdXUNehg==:17 a=kj9zAlcOel0A:10 a=Gh0u76Fc2OF9ojEVt64A: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 > > > > > + > > > + drm->dev_private = sprd; > > dev_private is deprecated. Alwyas use upclassing. > dev_private is deprecated ? I see everyone is still using it, so it > will be deprecated in the future? It is deprecated - and a lot of drivers is in need up an update to get away from using it. From the kernel-doc: /** * @dev_private: * * DRM driver private data. This is deprecated and should be left set to * NULL. * * Instead of using this pointer it is recommended that drivers use * drm_dev_init() and embed struct &drm_device in their larger * per-device structure. */ void *dev_private; > > > + } > > > + /* with irq_enabled = true, we can use the vblank feature. */ > > > + drm->irq_enabled = true; > > Can drm_irq_install() be used? > > Then this flag shall not be set by the driver, And the interrupt numbers on different Soc are not necessarily the same > > > We need to set "IRQ_NOAUTOEN" flag for CRTC IRQ, you can see that we > manually turn the interrupt on and off by crtc > atomic_enable/atomic_disable > and the interrupt number on different Soc are not necessarily the > same. So intall interrupt in kms maybe is not suitable for us... Maybe drm_irq_install() does not fit the need here. But please take an extra look as what is does is quite basic. And no need to roll your own if there is available infrstructure that can be used. But there is nothing wrong rolloing your own if needed. Sam