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 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5D6C5CF11F9 for ; Thu, 10 Oct 2024 14:41:00 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6917710E93D; Thu, 10 Oct 2024 14:40:58 +0000 (UTC) Received: from szxga06-in.huawei.com (szxga06-in.huawei.com [45.249.212.32]) by gabe.freedesktop.org (Postfix) with ESMTPS id ACAA910E157 for ; Thu, 10 Oct 2024 12:02:34 +0000 (UTC) Received: from mail.maildlp.com (unknown [172.19.163.44]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4XPT0C5cwJz2JYXR; Thu, 10 Oct 2024 20:02:35 +0800 (CST) Received: from kwepemd500013.china.huawei.com (unknown [7.221.188.12]) by mail.maildlp.com (Postfix) with ESMTPS id 1D67D1400DC; Thu, 10 Oct 2024 20:02:31 +0800 (CST) Received: from [10.159.166.136] (10.159.166.136) by kwepemd500013.china.huawei.com (7.221.188.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.34; Thu, 10 Oct 2024 20:02:29 +0800 Content-Type: multipart/alternative; boundary="------------BrGGtAav0NuAzEentySNtq1t" Message-ID: Date: Thu, 10 Oct 2024 20:02:28 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH drm-dp 1/4] drm/hisilicon/hibmc: add dp aux in hibmc drivers To: Jani Nikula CC: , , , , , , , , , , , , , , , References: <20240930100610.782363-1-shiyongbang@huawei.com> <20240930100610.782363-2-shiyongbang@huawei.com> <87bjztbsny.fsf@intel.com> From: s00452708 In-Reply-To: <87bjztbsny.fsf@intel.com> X-Originating-IP: [10.159.166.136] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemd500013.china.huawei.com (7.221.188.12) X-Mailman-Approved-At: Thu, 10 Oct 2024 14:40:55 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" --------------BrGGtAav0NuAzEentySNtq1t Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit > On Mon, 30 Sep 2024, shiyongbang wrote: >> From: baihan li >> >> Add dp aux read/write functions. They are basic functions >> and will be used later. > You're supposed to use struct drm_dp_aux, add a .transfer function, > initialize it with intel_dp_aux_init(), and register with > intel_dp_aux_register(). Then you can use the standard drm_dp_dpcd_* > calls to access aux. They handle a lot of the boilerplate for DP > aux. You'll also get the i2c and aux device nodes for free. As well as a > lot of helpers based on struct drm_dp_aux interface. > > There's a lot of duplication in this patch otherwise too. The DPCD > register macros, a dupe for struct drm_dp_aux_msg, etc. > > > BR, > Jani. Hi Jani, Thanks for your advice. I didn't notice that the drm framework has this implementation, and I'll use the struct drm_dp_aux and drm_dp_aux_init() function in the next version to simplify my code. And I will check if there are others implementation in drm_dp_helper.c. Baihan Li. --------------BrGGtAav0NuAzEentySNtq1t Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: 7bit
On Mon, 30 Sep 2024, shiyongbang <shiyongbang@huawei.com> wrote:
From: baihan li <libaihan@huawei.com>

Add dp aux read/write functions. They are basic functions
 and will be used later.
You're supposed to use struct drm_dp_aux, add a .transfer function,
initialize it with intel_dp_aux_init(), and register with
intel_dp_aux_register(). Then you can use the standard drm_dp_dpcd_*
calls to access aux. They handle a lot of the boilerplate for DP
aux. You'll also get the i2c and aux device nodes for free. As well as a
lot of helpers based on struct drm_dp_aux interface.

There's a lot of duplication in this patch otherwise too. The DPCD
register macros, a dupe for struct drm_dp_aux_msg, etc.


BR,
Jani.

    
Hi Jani,
  Thanks for your advice. I didn't notice that the drm framework 
  has this implementation, and I'll use the struct drm_dp_aux and 
  drm_dp_aux_init() function in the next version to simplify my code.

  And I will check if there are others implementation in drm_dp_helper.c.
  
  Baihan Li.


    
--------------BrGGtAav0NuAzEentySNtq1t--