Displaying 20 results from an estimated 115 matches for "drm_mode_create_dumb".
2025 Jan 10
0
[PATCH v2 02/25] drm/dumb-buffers: Provide helper to set pitch and size
...-buffer interface behave similar
>> the kernel's video= parameter. Again, current per-driver implementations
>> likely have subtle differences or bugs in how they support color modes.
>>
>> Future directions: one bug is present in the current input validation
>> in drm_mode_create_dumb(). The dumb-buffer overflow tests round up any
>> given bits-per-pixel value to a multiple of 8. So even one-bit formats,
>> such as DRM_FORMAT_C1, require 8 bits per pixel. While not common,
>> low-end displays use such formats; with a possible overcommitment of
>> memory....
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
2025 Jan 13
0
[PATCH v2 02/25] drm/dumb-buffers: Provide helper to set pitch and size
...>> + 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/include/drm/drm_dumb_buffers.h b/include/drm/drm_dumb_buffers.h
>>>> new file mode 100644
>>>> index 000000000000..6...
2025 Jan 19
1
[PATCH v2 25/25] drm/xlnx: Compute dumb-buffer sizes with drm_mode_size_dumb()
...he Y-planar appear first
>>> in memory as an array of unsigned char values. The Y-planar is followed
>>> immediately by the UV-planar, which is also an array of unsigned char
>>> values that contains packed U (Cb) and V (Cr) samples.
>>>
>>> But the 'drm_mode_create_dumb' structure is only intend to provide
>>> descriptions for *one* planar.
>>>
>>> struct drm_mode_create_dumb {
>>> ???? __u32 height;
>>> ???? __u32 width;
>>> ???? __u32 bpp;
>>> ???? __u32 flags;
>>> ???? __u32 handle;
>...
2025 Jan 19
1
[PATCH v2 25/25] drm/xlnx: Compute dumb-buffer sizes with drm_mode_size_dumb()
...and the UV-planar. The Y-planar appear first
>> in memory as an array of unsigned char values. The Y-planar is followed
>> immediately by the UV-planar, which is also an array of unsigned char
>> values that contains packed U (Cb) and V (Cr) samples.
>>
>> But the 'drm_mode_create_dumb' structure is only intend to provide
>> descriptions for *one* planar.
>>
>> struct drm_mode_create_dumb {
>> ???? __u32 height;
>> ???? __u32 width;
>> ???? __u32 bpp;
>> ???? __u32 flags;
>> ???? __u32 handle;
>> ???? __u32 pitch;
>>...
2025 Jan 19
1
[PATCH v2 25/25] drm/xlnx: Compute dumb-buffer sizes with drm_mode_size_dumb()
...gt; in memory as an array of unsigned char values. The Y-planar is
>>>> followed
>>>> immediately by the UV-planar, which is also an array of unsigned char
>>>> values that contains packed U (Cb) and V (Cr) samples.
>>>>
>>>> But the 'drm_mode_create_dumb' structure is only intend to provide
>>>> descriptions for *one* planar.
>>>>
>>>> struct drm_mode_create_dumb {
>>>> ???? __u32 height;
>>>> ???? __u32 width;
>>>> ???? __u32 bpp;
>>>> ???? __u32 flags;
>>...
2025 Jan 19
1
[PATCH v2 25/25] drm/xlnx: Compute dumb-buffer sizes with drm_mode_size_dumb()
...lanar format, have
two planar: the Y-planar and the UV-planar. The Y-planar appear first
in memory as an array of unsigned char values. The Y-planar is followed
immediately by the UV-planar, which is also an array of unsigned char
values that contains packed U (Cb) and V (Cr) samples.
But the 'drm_mode_create_dumb' structure is only intend to provide
descriptions for *one* planar.
struct drm_mode_create_dumb {
__u32 height;
__u32 width;
__u32 bpp;
__u32 flags;
__u32 handle;
__u32 pitch;
__u64 size;
};
An width x height NV12 image takes up width*height*(1 + 1/4 + 1/4)...
2025 Jan 09
1
[PATCH v2 15/25] drm/omapdrm: Compute dumb-buffer sizes with drm_mode_size_dumb()
...nclude <drm/drm_dumb_buffers.h>
#include <drm/drm_prime.h>
#include <drm/drm_vma_manager.h>
@@ -583,15 +584,13 @@ static int omap_gem_object_mmap(struct drm_gem_object *obj, struct vm_area_struc
int omap_gem_dumb_create(struct drm_file *file, struct drm_device *dev,
struct drm_mode_create_dumb *args)
{
- union omap_gem_size gsize;
-
- args->pitch = DIV_ROUND_UP(args->width * args->bpp, 8);
-
- args->size = PAGE_ALIGN(args->pitch * args->height);
+ union omap_gem_size gsize = { };
+ int ret;
- gsize = (union omap_gem_size){
- .bytes = args->size,
- };
+ ret = drm_...
2025 Jan 19
1
[PATCH v2 25/25] drm/xlnx: Compute dumb-buffer sizes with drm_mode_size_dumb()
...anar: the Y-planar and the UV-planar. The Y-planar appear first
> in memory as an array of unsigned char values. The Y-planar is followed
> immediately by the UV-planar, which is also an array of unsigned char
> values that contains packed U (Cb) and V (Cr) samples.
>
> But the 'drm_mode_create_dumb' structure is only intend to provide
> descriptions for *one* planar.
>
> struct drm_mode_create_dumb {
> ??? __u32 height;
> ??? __u32 width;
> ??? __u32 bpp;
> ??? __u32 flags;
> ??? __u32 handle;
> ??? __u32 pitch;
> ??? __u64 size;
> };
>
> An...
2025 Jan 19
1
[PATCH v2 25/25] drm/xlnx: Compute dumb-buffer sizes with drm_mode_size_dumb()
...; in memory as an array of unsigned char values. The Y-planar is followed
> >>>> immediately by the UV-planar, which is also an array of unsigned char
> >>>> values that contains packed U (Cb) and V (Cr) samples.
> >>>>
> >>>> But the 'drm_mode_create_dumb' structure is only intend to provide
> >>>> descriptions for *one* planar.
> >>>>
> >>>> struct drm_mode_create_dumb {
> >>>> ???? __u32 height;
> >>>> ???? __u32 width;
> >>>> ???? __u32 bpp;
> >>...
2025 Jan 09
1
[PATCH v2 25/25] drm/xlnx: Compute dumb-buffer sizes with drm_mode_size_dumb()
...rm_device.h>
#include <drm/drm_drv.h>
+#include <drm/drm_dumb_buffers.h>
#include <drm/drm_encoder.h>
#include <drm/drm_fbdev_dma.h>
#include <drm/drm_fourcc.h>
@@ -363,10 +364,12 @@ static int zynqmp_dpsub_dumb_create(struct drm_file *file_priv,
struct drm_mode_create_dumb *args)
{
struct zynqmp_dpsub *dpsub = to_zynqmp_dpsub(drm);
- unsigned int pitch = DIV_ROUND_UP(args->width * args->bpp, 8);
+ int ret;
/* Enforce the alignment constraints of the DMA engine. */
- args->pitch = ALIGN(pitch, dpsub->dma_align);
+ ret = drm_mode_size_dumb(drm, args,...
2015 Feb 19
1
[PATCH v3 1/6] make RAM device optional
...860b0e2d4181..68ee0af22eea 100644
> >> --- a/drm/nouveau/nouveau_display.c
> >> +++ b/drm/nouveau/nouveau_display.c
> >> @@ -869,13 +869,19 @@ nouveau_display_dumb_create(struct drm_file
*file_priv, struct drm_device *dev,
> >> struct drm_mode_create_dumb *args)
> >> {
> >> struct nouveau_bo *bo;
> >> + uint32_t domain;
> >> int ret;
> >>
> >> args->pitch = roundup(args->width * (args->bpp / 8), 256);
> >> args->size = args->pitch * a...
2019 May 06
0
[PATCH v4 12/19] drm/bochs: Convert bochs driver to VRAM MM
...did(struct bochs_device *bochs);
/* bochs_mm.c */
int bochs_mm_init(struct bochs_device *bochs);
void bochs_mm_fini(struct bochs_device *bochs);
-int bochs_mmap(struct file *filp, struct vm_area_struct *vma);
-
-int bochs_dumb_create(struct drm_file *file, struct drm_device *dev,
- struct drm_mode_create_dumb *args);
int bochs_gem_prime_pin(struct drm_gem_object *obj);
void bochs_gem_prime_unpin(struct drm_gem_object *obj);
diff --git a/drivers/gpu/drm/bochs/bochs_drv.c b/drivers/gpu/drm/bochs/bochs_drv.c
index 04fed41d6c00..f3bb5fba30bf 100644
--- a/drivers/gpu/drm/bochs/bochs_drv.c
+++ b/drivers/g...
2015 Feb 17
2
[PATCH v3 1/6] make RAM device optional
...nouveau/nouveau_display.c
> index 860b0e2d4181..68ee0af22eea 100644
> --- a/drm/nouveau/nouveau_display.c
> +++ b/drm/nouveau/nouveau_display.c
> @@ -869,13 +869,19 @@ nouveau_display_dumb_create(struct drm_file *file_priv, struct drm_device *dev,
> struct drm_mode_create_dumb *args)
> {
> struct nouveau_bo *bo;
> + uint32_t domain;
> int ret;
>
> args->pitch = roundup(args->width * (args->bpp / 8), 256);
> args->size = args->pitch * args->height;
> args->size = roundup(args->s...
2020 Aug 13
2
[PATCH 12/20] drm/radeon: Introduce GEM object functions
...unsigned int flags, int *vpos, int *hpos,
> ktime_t *stime, ktime_t *etime,
> @@ -145,14 +138,9 @@ int radeon_mode_dumb_mmap(struct drm_file *filp,
> int radeon_mode_dumb_create(struct drm_file *file_priv,
> struct drm_device *dev,
> struct drm_mode_create_dumb *args);
> -struct sg_table *radeon_gem_prime_get_sg_table(struct drm_gem_object *obj);
> struct drm_gem_object *radeon_gem_prime_import_sg_table(struct drm_device *dev,
> struct dma_buf_attachment *,
> struct sg_table *sg);
> -int radeon_gem_prime_pin(struct drm_g...
2015 Jan 24
1
[PATCH 1/6] make RAM device optional
...y.c b/drm/nouveau/nouveau_display.c
> index 860b0e2..b4f8ece 100644
> --- a/drm/nouveau/nouveau_display.c
> +++ b/drm/nouveau/nouveau_display.c
> @@ -869,13 +869,20 @@ nouveau_display_dumb_create(struct drm_file *file_priv, struct drm_device *dev,
> struct drm_mode_create_dumb *args)
> {
> struct nouveau_bo *bo;
> + uint32_t domain;
> int ret;
>
> args->pitch = roundup(args->width * (args->bpp / 8), 256);
> args->size = args->pitch * args->height;
> args->size = roundup(args->s...
2025 Jan 15
1
[PATCH v2 25/25] drm/xlnx: Compute dumb-buffer sizes with drm_mode_size_dumb()
...drm_drv.h>
> +#include <drm/drm_dumb_buffers.h>
> #include <drm/drm_encoder.h>
> #include <drm/drm_fbdev_dma.h>
> #include <drm/drm_fourcc.h>
> @@ -363,10 +364,12 @@ static int zynqmp_dpsub_dumb_create(struct drm_file *file_priv,
> struct drm_mode_create_dumb *args)
> {
> struct zynqmp_dpsub *dpsub = to_zynqmp_dpsub(drm);
> - unsigned int pitch = DIV_ROUND_UP(args->width * args->bpp, 8);
> + int ret;
>
> /* Enforce the alignment constraints of the DMA engine. */
> - args->pitch = ALIGN(pitch, dpsub->dma_align)...
2019 May 06
25
[PATCH v4 00/19] Share TTM code among DRM framebuffer drivers
Several simple framebuffer drivers copy most of the TTM code from each
other. The implementation is always the same; except for the name of
some data structures.
As recently discussed, this patch set provides generic memory-management
code for simple framebuffers with dedicated video memory. It further
converts the respective drivers to the generic code. The shared code
is basically the same
2019 May 06
25
[PATCH v4 00/19] Share TTM code among DRM framebuffer drivers
Several simple framebuffer drivers copy most of the TTM code from each
other. The implementation is always the same; except for the name of
some data structures.
As recently discussed, this patch set provides generic memory-management
code for simple framebuffers with dedicated video memory. It further
converts the respective drivers to the generic code. The shared code
is basically the same
2020 Sep 15
1
[PATCH v2 12/21] drm/radeon: Introduce GEM object functions
...vice *dev, unsigned int crtc,
unsigned int flags, int *vpos, int *hpos,
ktime_t *stime, ktime_t *etime,
@@ -145,14 +138,9 @@ int radeon_mode_dumb_mmap(struct drm_file *filp,
int radeon_mode_dumb_create(struct drm_file *file_priv,
struct drm_device *dev,
struct drm_mode_create_dumb *args);
-struct sg_table *radeon_gem_prime_get_sg_table(struct drm_gem_object *obj);
struct drm_gem_object *radeon_gem_prime_import_sg_table(struct drm_device *dev,
struct dma_buf_attachment *,
struct sg_table *sg);
-int radeon_gem_prime_pin(struct drm_gem_object *obj);
-void radeo...