search for: drm_mode_align_dumb

Displaying 3 results from an estimated 3 matches for "drm_mode_align_dumb".

2025 Jan 10
2
[PATCH v2 02/25] drm/dumb-buffers: Provide helper to set pitch and size
...umb_buffers.h> >> +#include <drm/drm_fourcc.h> >> #include <drm/drm_gem.h> >> #include <drm/drm_mode.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...
2025 Jan 13
0
[PATCH v2 02/25] drm/dumb-buffers: Provide helper to set pitch and size
...;> + return -EINVAL; >>>> + 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) >...
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