mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hamza Mahfooz <hamza.mahfooz@amd.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>
Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
	Javier Martinez Canillas <javierm@redhat.com>
Subject: Re: [PATCH v3] drm/client: Convert drm_client_buffer_addfb() to drm_mode_addfb2()
Date: Tue, 24 Oct 2023 12:33:23 -0400	[thread overview]
Message-ID: <16225a07-c0da-4970-b0a1-39831b1bf616@amd.com> (raw)
In-Reply-To: <4b84adfc686288714e69d0442d22f1259ff74903.1697379891.git.geert@linux-m68k.org>

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 <geert@linux-m68k.org>
> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
> Tested-by: Javier Martinez Canillas <javierm@redhat.com>

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


      reply	other threads:[~2023-10-24 16:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-15 14:27 Geert Uytterhoeven
2023-10-24 16:33 ` Hamza Mahfooz [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=16225a07-c0da-4970-b0a1-39831b1bf616@amd.com \
    --to=hamza.mahfooz@amd.com \
    --cc=airlied@gmail.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=geert@linux-m68k.org \
    --cc=javierm@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®