search for: pitch_align

Displaying 11 results from an estimated 11 matches for "pitch_align".

2025 Jan 10
0
[PATCH v2 02/25] drm/dumb-buffers: Provide helper to set pitch and size
...rm_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) >> + pitch = roundup(pitch, pitch_align); >> + >> + /* overf...
2025 Jan 09
1
[PATCH v2 13/25] drm/msm: Compute dumb-buffer sizes with drm_mode_size_dumb()
..., int msm_gem_dumb_create(struct drm_file *file, struct drm_device *dev, struct drm_mode_create_dumb *args) { - args->pitch = align_pitch(args->width, args->bpp); - args->size = PAGE_ALIGN(args->pitch * args->height); + u32 fourcc; + const struct drm_format_info *info; + u64 pitch_align; + int ret; + + /* + * Adreno needs pitch aligned to 32 pixels. Compute the number + * of bytes for a block of 32 pixels at the given color format. + * Use the result as pitch alignment. + */ + fourcc = drm_driver_color_mode_format(dev, args->bpp); + if (fourcc == DRM_FORMAT_INVALID) + retu...
2025 Jan 09
1
[PATCH v2 10/25] drm/imx/ipuv3: Compute dumb-buffer sizes with drm_mode_size_dumb()
...lper.h> #include <drm/drm_managed.h> @@ -141,19 +143,32 @@ static int imx_drm_dumb_create(struct drm_file *file_priv, struct drm_device *drm, struct drm_mode_create_dumb *args) { - u32 width = args->width; + u32 fourcc; + const struct drm_format_info *info; + u64 pitch_align; int ret; - args->width = ALIGN(width, 8); - args->pitch = DIV_ROUND_UP(args->width * args->bpp, 8); - args->size = args->pitch * args->height; - - ret = drm_gem_dma_dumb_create(file_priv, drm, args); + /* + * Hardware requires the framebuffer width to be aligned to + * m...
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 09
1
[PATCH v2 11/25] drm/loongson: Compute dumb-buffer sizes with drm_mode_size_dumb()
...uct drm_gem_object *gobj; - size_t size; - u32 pitch; - u32 handle; int ret; - if (!args->width || !args->height) - return -EINVAL; - - if (args->bpp != 32 && args->bpp != 16) - return -EINVAL; - - pitch = args->width * args->bpp / 8; - pitch = ALIGN(pitch, descp->pitch_align); - size = pitch * args->height; - size = ALIGN(size, PAGE_SIZE); + ret = drm_mode_size_dumb(ddev, args, descp->pitch_align, 0); + if (ret) + return ret; /* Maximum single bo size allowed is the half vram size available */ - if (size > ldev->vram_size / 2) { - drm_err(ddev, "...
2009 Dec 11
2
[PATCH 1/2] exa: Pre-G80 tiling support.
...e_hint == NOUVEAU_CREATE_PIXMAP_ZETA) + if (usage_hint & NOUVEAU_CREATE_PIXMAP_ZETA) tile_flags = 0x2800; else tile_flags = 0x7000; height = NOUVEAU_ALIGN(height, 1 << (tile_mode + 2)); - } + } else { + if (usage_hint & NOUVEAU_CREATE_PIXMAP_TILED) { + int pitch_align = + pNv->NVArch >= 0x40 ? 512 : 256; - *new_pitch = width * cpp; + *new_pitch = NOUVEAU_ALIGN(*new_pitch, + pitch_align); + tile_mode = *new_pitch; + } + } } else { *new_pitch = (width * bitsPerPixel + 7) / 8; } @@ -437,12 +445,13 @@ nouveau_exa_destroy_pixmap(...
2025 Jan 13
0
[PATCH v2 02/25] drm/dumb-buffers: Provide helper to set pitch and size
...gt;>>> + 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...
2015 Sep 03
10
[PATCH mesa 0/4] nv30: Various fixes
Hi All, Here is a bunch of fixes for nv30 cards, the first patch is a resend of a patch I send a while back. AFAICT that one is ready for merging, but it is not entirely clear to me what the process is for getting (nouveau) mesa patches merged. Should I request commit rights, and push my own patches once they have been reviewed ? Regards, Hans
2015 Aug 10
2
"enable dri3 support without glamor" causes gnome-shell regression on nv4x
Hi, On 03-08-15 20:09, Ilia Mirkin wrote: > On Mon, Aug 3, 2015 at 1:31 PM, Hans de Goede <hdegoede at redhat.com> wrote: >> Hi, >> >> >> On 03-08-15 17:36, Ilia Mirkin wrote: >>> >>> On Mon, Aug 3, 2015 at 9:02 AM, Hans de Goede <hdegoede at redhat.com> wrote: >>>> >>>> Hi, >>>> >>>> On
2013 Jun 30
0
[PATCH v2] nv50: H.264/MPEG2 decoding support via VP2, available on NV84-NV96, NVA0
...--git a/src/gallium/drivers/nv50/nv50_miptree.c b/src/gallium/drivers/nv50/nv50_miptree.c index 036f1c7..28be768 100644 --- a/src/gallium/drivers/nv50/nv50_miptree.c +++ b/src/gallium/drivers/nv50/nv50_miptree.c @@ -239,6 +239,28 @@ nv50_miptree_init_layout_linear(struct nv50_miptree *mt, unsigned pitch_align) } static void +nv50_miptree_init_layout_video(struct nv50_miptree *mt) +{ + const struct pipe_resource *pt = &mt->base.base; + const unsigned blocksize = util_format_get_blocksize(pt->format); + + assert(pt->last_level == 0); + assert(mt->ms_x == 0 && mt->ms_...
2013 Jun 27
4
[PATCH] nv50: H.264/MPEG2 decoding support via VP2, available on NV84-NV96, NVA0
...--git a/src/gallium/drivers/nv50/nv50_miptree.c b/src/gallium/drivers/nv50/nv50_miptree.c index 036f1c7..28be768 100644 --- a/src/gallium/drivers/nv50/nv50_miptree.c +++ b/src/gallium/drivers/nv50/nv50_miptree.c @@ -239,6 +239,28 @@ nv50_miptree_init_layout_linear(struct nv50_miptree *mt, unsigned pitch_align) } static void +nv50_miptree_init_layout_video(struct nv50_miptree *mt) +{ + const struct pipe_resource *pt = &mt->base.base; + const unsigned blocksize = util_format_get_blocksize(pt->format); + + assert(pt->last_level == 0); + assert(mt->ms_x == 0 && mt->ms_...