Displaying 3 results from an estimated 3 matches for "size_align".
Did you mean:
file_align
2025 Jan 10
2
[PATCH v2 02/25] drm/dumb-buffers: Provide helper to set pitch and size
....h>
>>
>> @@ -57,6 +59,97 @@
>> * a hardware-specific ioctl to allocate suitable buffer objects.
>> */
>>
>> +static int drm_mode_align_dumb(struct drm_mode_create_dumb *args,
>> + unsigned long pitch_align,
>> + unsigned long size_align)
>> +{
>> + u32 pitch = args->pitch;
>> + u32 size;
>> +
>> + if (!pitch)
>> + return -EINVAL;
>> +
>> + if (pitch_align)
>> + pitch = roundup(pitch, pitch_align);
>> +
>> + /* overflow checks for 32bit size calculations */
>...
2025 Jan 13
0
[PATCH v2 02/25] drm/dumb-buffers: Provide helper to set pitch and size
...t; + pitch = drm_format_info_min_pitch(info, 0, args->width);
>>>> + if (!pitch || pitch > U32_MAX)
>>>> + return -EINVAL;
>>>> +
>>>> + args->pitch = pitch;
>>>> +
>>>> + return drm_mode_align_dumb(args, pitch_align, size_align);
>>>> +}
>>>> +EXPORT_SYMBOL(drm_mode_size_dumb);
>>>> +
>>>> int drm_mode_create_dumb(struct drm_device *dev,
>>>> struct drm_mode_create_dumb *args,
>>>> struct drm_file *file_priv)
>>>> diff --git a/incl...
2025 Jan 09
25
[PATCH v2 00/25] drm/dumb-buffers: Fix and improve buffer-size calculation
Dumb-buffer pitch and size is specified by width, height, bits-per-pixel
plus various hardware-specific alignments. The calculation of these
values is inconsistent and duplicated among drivers. The results for
formats with bpp < 8 are incorrect.
This series fixes this for most drivers. Default scanline pitch and
buffer size are now calculated with the existing 4CC helpers. There is
a new