Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/client: Remove pitch from struct drm_client_buffer

Only the client-buffer setup uses the pitch field from struct
drm_client_buffer. Remove the field and pass the value among setup
helpers.

Clients that need the pitch should rather look at the framebuffer's
pitches[0] directly.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Tested-by: Francesco Valla <francesco@valla.it>
Link: https://patch.msgid.link/20251027121042.143588-2-tzimmermann@suse.de

+7 -12
+7 -7
drivers/gpu/drm/drm_client.c
··· 188 188 189 189 static struct drm_client_buffer * 190 190 drm_client_buffer_create(struct drm_client_dev *client, u32 width, u32 height, 191 - u32 format, u32 *handle) 191 + u32 format, u32 *handle, u32 *pitch) 192 192 { 193 193 const struct drm_format_info *info = drm_format_info(format); 194 194 struct drm_mode_create_dumb dumb_args = { }; ··· 216 216 goto err_delete; 217 217 } 218 218 219 - buffer->pitch = dumb_args.pitch; 220 219 buffer->gem = obj; 221 220 *handle = dumb_args.handle; 221 + *pitch = dumb_args.pitch; 222 222 223 223 return buffer; 224 224 ··· 353 353 354 354 static int drm_client_buffer_addfb(struct drm_client_buffer *buffer, 355 355 u32 width, u32 height, u32 format, 356 - u32 handle) 356 + u32 handle, u32 pitch) 357 357 { 358 358 struct drm_client_dev *client = buffer->client; 359 359 struct drm_mode_fb_cmd2 fb_req = { }; ··· 363 363 fb_req.height = height; 364 364 fb_req.pixel_format = format; 365 365 fb_req.handles[0] = handle; 366 - fb_req.pitches[0] = buffer->pitch; 366 + fb_req.pitches[0] = pitch; 367 367 368 368 ret = drm_mode_addfb2(client->dev, &fb_req, client->file); 369 369 if (ret) ··· 399 399 drm_client_framebuffer_create(struct drm_client_dev *client, u32 width, u32 height, u32 format) 400 400 { 401 401 struct drm_client_buffer *buffer; 402 - u32 handle; 402 + u32 handle, pitch; 403 403 int ret; 404 404 405 405 buffer = drm_client_buffer_create(client, width, height, format, 406 - &handle); 406 + &handle, &pitch); 407 407 if (IS_ERR(buffer)) 408 408 return buffer; 409 409 410 - ret = drm_client_buffer_addfb(buffer, width, height, format, handle); 410 + ret = drm_client_buffer_addfb(buffer, width, height, format, handle, pitch); 411 411 412 412 /* 413 413 * The handle is only needed for creating the framebuffer, destroy it
-5
include/drm/drm_client.h
··· 174 174 struct drm_client_dev *client; 175 175 176 176 /** 177 - * @pitch: Buffer pitch 178 - */ 179 - u32 pitch; 180 - 181 - /** 182 177 * @gem: GEM object backing this buffer 183 178 * 184 179 * FIXME: The dependency on GEM here isn't required, we could