Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp2010132rda; Tue, 24 Oct 2023 09:33:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFPndlI1zdOyOcu7kKIKzrLwP/DO1uGpSzsAvRSnaUsN101SnfzK7RZTeQPFmYMITZLcRy7 X-Received: by 2002:a17:902:ec89:b0:1c7:1f3f:b6dc with SMTP id x9-20020a170902ec8900b001c71f3fb6dcmr10525036plg.11.1698165223971; Tue, 24 Oct 2023 09:33:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1698165223; cv=pass; d=google.com; s=arc-20160816; b=XzydfhDSJn3jOm98pKRqpWcAutksSgUtvB6H9wNgDVgZK3JXxEKBqZudFJaweK3CzH ka4MY0JEQ5HPtge0+Oh9iycQ6tXcaUrLz3XES0/EDXeg0trCIgT5w9eeEasrnvoI0zqY PPspSfVuXESGDPc9UiMu7+o6yCHviGmHb53L3pFpjk2fmC2CgMgLDCDU7x9V7Hi+XlBE Lz+8D4rVkRusgukuwT4E3HMkK2S4dX7weMGsWOzVwl2IRvHbjjlsLY9VSVJWtSvATnsW 44yBo5+z4nDT1k3lNlQStwcj2QbJtXxfqx7v6WDP7wPFzBkf2X9R0rTcKglirXYQQd5q lbVA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:content-language:references:cc:to:subject :user-agent:date:message-id:dkim-signature; bh=zdPxYLzGgeQdUW9fMmK+mbFWUIOAi2eljhoHpYDKTnw=; fh=BvO1xKcfhLo7Z1bxdW51w6iGSnAdK0S5Gc7x2TCuF0s=; b=OQ/MuT6ufZ4vuBOIuNpnZeddAzjBVxHzC2Ii0Z8f0dnqx7Ic0c3G8tRq/iYSlZfkjv R/ul/SEWbzTZgYyHFKD856qMyikx2YG8HbbhoD59jhfDINaE1CjTU6CIYzyFotxp+qfu yEySFIR0kR72bfHvvr0Yh2GMefAqNOSXyWG0COM0VHJSagzGXvOPbiiazBWF3QBB996V Mmm2JAYO7m9KlLNQQihSIx6fqzRbDEmGpcmN7p+E7qUORKaslh9Ice1z2K5Sc4vb2FCY HiNrKQ0fIbKHDb/Nrq4kNxOoDn9AXejLqiWCfL+yAKePsL21KZtUUq+GJi/2pgYy4q46 Fe5Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=eQZYhqX8; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id c23-20020a170902b69700b001bb95a5cb9fsi8308145pls.522.2023.10.24.09.33.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 09:33:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=eQZYhqX8; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id E7874802685D; Tue, 24 Oct 2023 09:33:40 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343912AbjJXQdd (ORCPT + 99 others); Tue, 24 Oct 2023 12:33:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343881AbjJXQdb (ORCPT ); Tue, 24 Oct 2023 12:33:31 -0400 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2042.outbound.protection.outlook.com [40.107.237.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 41C0A93 for ; Tue, 24 Oct 2023 09:33:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fhbyDnxM7R9XW67e2ij1POBjB7O2mDYtYcR0PP9OSq3vHHnHUD2FWK/UJBd++XqNrBaB35tUmBiGjHuRTpxStX6K98I2OiWDp8z5Oiy7T5omN/ro2+enE2NkNTBGVZHvXr5bHbMNY7JL2wJOAAaOj8slfv5H8KxN/x4X6ymd1qyw0Jpe5bFlfSv+Xu5U2SEbXwz4OS+6eCnlJl56sWpYvauH+VbdFJlaEMV9v2wYd+x/m2utOPQXqzMrq7hxvZ7yXWGKH79uotVzgvC0Z8IbEsX+c/rx/ghzor6E+FIWjt8mKynw7GDk5pPiqWFIk9Y0bs+yVh9qgSRcd2KiprZ2KQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=zdPxYLzGgeQdUW9fMmK+mbFWUIOAi2eljhoHpYDKTnw=; b=CFU/zGeDdZjvXjrjEN6yZJf6QWpHFy71+eTMvtr7LFXuLHu0oTplRWGDD8zDP1sHO4BBizXRtuC3VojsCPlAmeyxm2qjVlwLsFtjXmsz9gml1Ut0rzQN80X8+iyNmoB2kdlDTe78jpdfgbgSoqFX7lIAvIPqHjzwJ8xD3ZkyDMiK/Jn5aluHuBWr/4z4ZQ98850V5tqXhdfKGPc8mXdktIIVGz/emq9LfxEUAc2DZAIMZN6PzU7fSxq+tIEcq3EoZ4P0gBnxSRpzyeLPIGhzlGhyYPO2/FnghJNDakE5IM3hJFdXZMXZwF2P6VrgKSecJJTqrnNhk+Ovafqdz+XLew== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zdPxYLzGgeQdUW9fMmK+mbFWUIOAi2eljhoHpYDKTnw=; b=eQZYhqX8we1uAl99zQQKGeK1MDeTMy1ymwH9OHV97CEmPgjSWm1zK9mfxu1GMhQ+WyE+oj2uoqidalxms3N22HeR1Yw5zFD+cEQqiFkBfnBcdQ7DyGu5PPl7Y6MNW4pqICk56LLh3GS6ls/pNuftZe8hm1p0/j6ERr0ieB7GySM= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from DM4PR12MB6280.namprd12.prod.outlook.com (2603:10b6:8:a2::11) by SA3PR12MB7973.namprd12.prod.outlook.com (2603:10b6:806:305::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.33; Tue, 24 Oct 2023 16:33:26 +0000 Received: from DM4PR12MB6280.namprd12.prod.outlook.com ([fe80::5588:7117:d54e:9466]) by DM4PR12MB6280.namprd12.prod.outlook.com ([fe80::5588:7117:d54e:9466%6]) with mapi id 15.20.6907.028; Tue, 24 Oct 2023 16:33:26 +0000 Message-ID: <16225a07-c0da-4970-b0a1-39831b1bf616@amd.com> Date: Tue, 24 Oct 2023 12:33:23 -0400 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3] drm/client: Convert drm_client_buffer_addfb() to drm_mode_addfb2() To: Geert Uytterhoeven , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Javier Martinez Canillas References: <4b84adfc686288714e69d0442d22f1259ff74903.1697379891.git.geert@linux-m68k.org> Content-Language: en-US From: Hamza Mahfooz In-Reply-To: <4b84adfc686288714e69d0442d22f1259ff74903.1697379891.git.geert@linux-m68k.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: YQBPR01CA0005.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c01::13) To DM4PR12MB6280.namprd12.prod.outlook.com (2603:10b6:8:a2::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM4PR12MB6280:EE_|SA3PR12MB7973:EE_ X-MS-Office365-Filtering-Correlation-Id: 8404caf7-e4c9-4c4a-7a28-08dbd4aef293 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tIkya6KMlpKTLxFdCEojdUF4P6Q6+TrQz+xCg3ao3aIy2O1QxAsgK2ulpDba+Ispx0u5xRPQiutU3txf29zGLDN/YM8/oRwqgYEYXEbfDrZmL/1S4hW/rQJj7aKtLJkAWG3scogrH8eDYmNvjoqEseShEYjuyzI5Y/Xxz7vslRxdN2HsWgYPuydmEEG/DrpkihnoTezA4llyJ8y6C//lH0NjWMXDJCKJQTweJGAYXTA3Kk9a25el2Xqhgfuo6X5Vr6QLNtecsDrg56w/koYvyw850be3k1NTUsJlsX32Yin+50l+4flmgR58nbxvaGwa636iCK5Nu0E8Beaeorb6z4dcWpixNO9+F0X02QQr9VtIHUS93h9fxskhK05+hWCe/AxBhLh1GErjZy3l1v2aqGSxRChqX5bGsBAA/Fpc3l+PPpUwxhqpjrCBwrgQg9YoMEyWjI9tLXTcxMi6kvjgVYUz2ghXPY8/4FoYSoCIFsuAR/KGc+wxiDuOfNfUsJ9/wunDYjqr3hlG4JRIWmioEocU4v6akDcv/OJMYRi3PVYlCocvy3Tcp5J7LoKCV2TwdOKDu/SjWai2H6qm8sdxgkbtUV8ar4AqecBCR5UGRPd6uIHK9VZkYBfAVVuf1J+no87Lzfj0+LU/26u8VpGodw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM4PR12MB6280.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366004)(39860400002)(346002)(396003)(136003)(376002)(230922051799003)(451199024)(186009)(1800799009)(64100799003)(44832011)(2906002)(38100700002)(110136005)(66476007)(66556008)(316002)(2616005)(6506007)(478600001)(6666004)(66946007)(26005)(53546011)(6486002)(83380400001)(6512007)(41300700001)(31696002)(36756003)(5660300002)(86362001)(4326008)(8936002)(8676002)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?SG5XZVd0bCsyVkxHNE9KeTQ3QkdJdWdLYWlUMGxISG1NOUdHV3hVNGViL1dR?= =?utf-8?B?WU8wMGNZcHN2c2tDdVNrbjZaalZncjFLdG1yRXZYS01HeEhFTzQxUzRvVlVO?= =?utf-8?B?NERDQTBmMEZwdEk1bVozZEMvc2VZVlRVenZZQ3FPOFBuZmpUZVdvTWUvelJG?= =?utf-8?B?bFBGNWpyTk94eGEzQllnWC92b01ray81cWlweG9VNkZkRjdZbmhsNFdNTUx4?= =?utf-8?B?QndZNnhISUhLSzY0Mi9uY3ZBL0dqc2xGMG5UUGtudXU3b2RxVnUza1BOMlJF?= =?utf-8?B?dXR6SU94NC8vckFDb2JRYjI1M3lxSX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A89Iy1Ucz++cHNXS9ZLuqSWA?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8404caf7-e4c9-4c4a-7a28-08dbd4aef293 X-MS-Exchange-CrossTenant-AuthSource: DM4PR12MB6280.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Oct 2023 16:33:26.3566 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: faeXnnn+PKnb7cDypAEafTUP4I08f7duvwEw1hJn2QWZbZSKXPNRz5uYOzhvA1+7KDQs27TGEnraUj6aHKKQWg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR12MB7973 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Tue, 24 Oct 2023 09:33:41 -0700 (PDT) On 10/15/23 10:27, Geert Uytterhoeven wrote: > Currently drm_client_buffer_addfb() uses the legacy drm_mode_addfb(), > which uses bpp and depth to guess the wanted buffer format. > However, drm_client_buffer_addfb() already knows the exact buffer > format, so there is no need to convert back and forth between buffer > format and bpp/depth, and the function can just call drm_mode_addfb2() > directly instead. > > Signed-off-by: Geert Uytterhoeven > Reviewed-by: Javier Martinez Canillas > Tested-by: Javier Martinez Canillas Applied and pushed to drm-misc-next, thanks! > --- > v3: > - Extract from series "[PATCH v2 0/8] drm: fb-helper/ssd130x: Add > support for DRM_FORMAT_R1" > (https://lore.kernel.org/all/cover.1692888745.git.geert@linux-m68k.org), > as this patch has merits on its own, > v2: > - Add Reviewed-by, Tested-by, > - s/drm_mode_create_dumb/drm_client_buffer_addfb/ in one-line summary. > --- > drivers/gpu/drm/drm_client.c | 13 +++++-------- > 1 file changed, 5 insertions(+), 8 deletions(-) > > diff --git a/drivers/gpu/drm/drm_client.c b/drivers/gpu/drm/drm_client.c > index d4296440f297fc5a..a780832a0963fe38 100644 > --- a/drivers/gpu/drm/drm_client.c > +++ b/drivers/gpu/drm/drm_client.c > @@ -395,19 +395,16 @@ static int drm_client_buffer_addfb(struct drm_client_buffer *buffer, > u32 handle) > { > struct drm_client_dev *client = buffer->client; > - struct drm_mode_fb_cmd fb_req = { }; > - const struct drm_format_info *info; > + struct drm_mode_fb_cmd2 fb_req = { }; > int ret; > > - info = drm_format_info(format); > - fb_req.bpp = drm_format_info_bpp(info, 0); > - fb_req.depth = info->depth; > fb_req.width = width; > fb_req.height = height; > - fb_req.handle = handle; > - fb_req.pitch = buffer->pitch; > + fb_req.pixel_format = format; > + fb_req.handles[0] = handle; > + fb_req.pitches[0] = buffer->pitch; > > - ret = drm_mode_addfb(client->dev, &fb_req, client->file); > + ret = drm_mode_addfb2(client->dev, &fb_req, client->file); > if (ret) > return ret; > -- Hamza