search for: mode_cmd

Displaying 20 results from an estimated 112 matches for "mode_cmd".

2018 Sep 05
0
[PATCH v2 5/6] drm/bochs: fix DRM_FORMAT_* handling for big endian machines.
...deletions(-) diff --git a/drivers/gpu/drm/bochs/bochs_fbdev.c b/drivers/gpu/drm/bochs/bochs_fbdev.c index 14eb8d0d5a..bf728790fa 100644 --- a/drivers/gpu/drm/bochs/bochs_fbdev.c +++ b/drivers/gpu/drm/bochs/bochs_fbdev.c @@ -64,9 +64,8 @@ static int bochsfb_create(struct drm_fb_helper *helper, mode_cmd.width = sizes->surface_width; mode_cmd.height = sizes->surface_height; - mode_cmd.pitches[0] = mode_cmd.width * ((sizes->surface_bpp + 7) / 8); - mode_cmd.pixel_format = drm_mode_legacy_fb_format(sizes->surface_bpp, - sizes->surface_depth); + mode_cmd.pitches[0] = sizes-&gt...
2018 Sep 03
0
[PATCH 4/5] drm/bochs: fix DRM_FORMAT_* handling for big endian machines.
...mp;bochs_fops, diff --git a/drivers/gpu/drm/bochs/bochs_fbdev.c b/drivers/gpu/drm/bochs/bochs_fbdev.c index 14eb8d0d5a..bf728790fa 100644 --- a/drivers/gpu/drm/bochs/bochs_fbdev.c +++ b/drivers/gpu/drm/bochs/bochs_fbdev.c @@ -64,9 +64,8 @@ static int bochsfb_create(struct drm_fb_helper *helper, mode_cmd.width = sizes->surface_width; mode_cmd.height = sizes->surface_height; - mode_cmd.pitches[0] = mode_cmd.width * ((sizes->surface_bpp + 7) / 8); - mode_cmd.pixel_format = drm_mode_legacy_fb_format(sizes->surface_bpp, - sizes->surface_depth); + mode_cmd.pitches[0] = sizes-&gt...
2018 Sep 19
0
[PATCH v3 3/5] drm/bochs: fix DRM_FORMAT_* handling for big endian machines.
...deletions(-) diff --git a/drivers/gpu/drm/bochs/bochs_fbdev.c b/drivers/gpu/drm/bochs/bochs_fbdev.c index 8f4d6c052f..c46fdae44e 100644 --- a/drivers/gpu/drm/bochs/bochs_fbdev.c +++ b/drivers/gpu/drm/bochs/bochs_fbdev.c @@ -63,9 +63,8 @@ static int bochsfb_create(struct drm_fb_helper *helper, mode_cmd.width = sizes->surface_width; mode_cmd.height = sizes->surface_height; - mode_cmd.pitches[0] = mode_cmd.width * ((sizes->surface_bpp + 7) / 8); - mode_cmd.pixel_format = drm_mode_legacy_fb_format(sizes->surface_bpp, - sizes->surface_depth); + mode_cmd.pitches[0] = sizes-&gt...
2020 Jan 06
1
[PATCH v2 2/3] drm/nouveau: Check framebuffer size against bo
...nvbo->bo.mem.size); > + > + if (bl_size + offset > nvbo->bo.mem.size) > + return -ERANGE; > + > + return 0; > +} > + > int > nouveau_framebuffer_new(struct drm_device *dev, > const struct drm_mode_fb_cmd2 *mode_cmd, > @@ -232,6 +298,8 @@ nouveau_framebuffer_new(struct drm_device *dev, > { > struct nouveau_drm *drm = nouveau_drm(dev); > struct nouveau_framebuffer *fb; > + const struct drm_format_info *info; > + unsigned int width, height, i; > int ret;...
2017 Apr 03
2
[PATCH 1/2] drm: virtio: add virtio_gpu_translate_format
...int index); diff --git a/drivers/gpu/drm/virtio/virtgpu_fb.c b/drivers/gpu/drm/virtio/virtgpu_fb.c index 9bfaef3..33df067 100644 --- a/drivers/gpu/drm/virtio/virtgpu_fb.c +++ b/drivers/gpu/drm/virtio/virtgpu_fb.c @@ -231,63 +231,9 @@ static int virtio_gpufb_create(struct drm_fb_helper *helper, mode_cmd.pitches[0] = mode_cmd.width * 4; mode_cmd.pixel_format = drm_mode_legacy_fb_format(32, 24); - switch (mode_cmd.pixel_format) { -#ifdef __BIG_ENDIAN - case DRM_FORMAT_XRGB8888: - format = VIRTIO_GPU_FORMAT_X8R8G8B8_UNORM; - break; - case DRM_FORMAT_ARGB8888: - format = VIRTIO_GPU_FORMAT_A8R8G...
2017 Apr 03
2
[PATCH 1/2] drm: virtio: add virtio_gpu_translate_format
...int index); diff --git a/drivers/gpu/drm/virtio/virtgpu_fb.c b/drivers/gpu/drm/virtio/virtgpu_fb.c index 9bfaef3..33df067 100644 --- a/drivers/gpu/drm/virtio/virtgpu_fb.c +++ b/drivers/gpu/drm/virtio/virtgpu_fb.c @@ -231,63 +231,9 @@ static int virtio_gpufb_create(struct drm_fb_helper *helper, mode_cmd.pitches[0] = mode_cmd.width * 4; mode_cmd.pixel_format = drm_mode_legacy_fb_format(32, 24); - switch (mode_cmd.pixel_format) { -#ifdef __BIG_ENDIAN - case DRM_FORMAT_XRGB8888: - format = VIRTIO_GPU_FORMAT_X8R8G8B8_UNORM; - break; - case DRM_FORMAT_ARGB8888: - format = VIRTIO_GPU_FORMAT_A8R8G...
2019 Dec 11
2
[PATCH 3/3] drm/nouveau: Support NVIDIA format modifiers
...; + uint32_t tile_mode; > + uint8_t kind; > int ret; > > /* YUV overlays have special requirements pre-NV50 */ > @@ -322,6 +368,18 @@ nouveau_framebuffer_new(struct drm_device *dev, > return -EINVAL; > } > > + if (mode_cmd->flags & DRM_MODE_FB_MODIFIERS) { > + if (nouveau_decode_mod(drm, mode_cmd->modifier[0], &tile_mode, > + &kind)) { > + DRM_DEBUG_KMS("Unsupported modifier: 0x%llx\n", > +...
2018 Dec 19
0
[PATCH 13/14] drm/bochs: drop old fbdev emulation code
..., - DRM_FB_HELPER_DEFAULT_OPS, - .fb_fillrect = drm_fb_helper_cfb_fillrect, - .fb_copyarea = drm_fb_helper_cfb_copyarea, - .fb_imageblit = drm_fb_helper_cfb_imageblit, - .fb_mmap = bochsfb_mmap, -}; - -static int bochsfb_create_object(struct bochs_device *bochs, - const struct drm_mode_fb_cmd2 *mode_cmd, - struct drm_gem_object **gobj_p) -{ - struct drm_device *dev = bochs->dev; - struct drm_gem_object *gobj; - u32 size; - int ret = 0; - - size = mode_cmd->pitches[0] * mode_cmd->height; - ret = bochs_gem_create(dev, size, true, &gobj); - if (ret) - return ret; - - *gobj_p = gobj;...
2018 Sep 05
0
[PATCH v2 6/6] drm/virtio: fix DRM_FORMAT_* handling
...rtio/virtgpu_display.c index 25503b9335..14a13edc02 100644 --- a/drivers/gpu/drm/virtio/virtgpu_display.c +++ b/drivers/gpu/drm/virtio/virtgpu_display.c @@ -306,6 +306,10 @@ virtio_gpu_user_framebuffer_create(struct drm_device *dev, struct virtio_gpu_framebuffer *virtio_gpu_fb; int ret; + if (mode_cmd->pixel_format != DRM_FORMAT_HOST_XRGB8888 && + mode_cmd->pixel_format != DRM_FORMAT_HOST_ARGB8888) + return ERR_PTR(-ENOENT); + /* lookup object associated with res handle */ obj = drm_gem_object_lookup(file_priv, mode_cmd->handles[0]); if (!obj) @@ -354,6 +358,7 @@ int...
2018 Sep 19
0
[PATCH v3 5/5] drm/virtio: fix DRM_FORMAT_* handling
...rtio/virtgpu_display.c index 0379d68976..8f8fed471e 100644 --- a/drivers/gpu/drm/virtio/virtgpu_display.c +++ b/drivers/gpu/drm/virtio/virtgpu_display.c @@ -307,6 +307,10 @@ virtio_gpu_user_framebuffer_create(struct drm_device *dev, struct virtio_gpu_framebuffer *virtio_gpu_fb; int ret; + if (mode_cmd->pixel_format != DRM_FORMAT_HOST_XRGB8888 && + mode_cmd->pixel_format != DRM_FORMAT_HOST_ARGB8888) + return ERR_PTR(-ENOENT); + /* lookup object associated with res handle */ obj = drm_gem_object_lookup(file_priv, mode_cmd->handles[0]); if (!obj) @@ -355,6 +359,7 @@ int...
2018 Sep 03
0
[PATCH 5/5] drm/virtio: fix DRM_FORMAT_* handling
...rtio/virtgpu_display.c index 25503b9335..f6c4af1db4 100644 --- a/drivers/gpu/drm/virtio/virtgpu_display.c +++ b/drivers/gpu/drm/virtio/virtgpu_display.c @@ -306,6 +306,10 @@ virtio_gpu_user_framebuffer_create(struct drm_device *dev, struct virtio_gpu_framebuffer *virtio_gpu_fb; int ret; + if (mode_cmd->pixel_format != DRM_FORMAT_HOST_XRGB8888 && + mode_cmd->pixel_format != DRM_FORMAT_HOST_ARGB8888) + return ERR_PTR(-ENOENT); + /* lookup object associated with res handle */ obj = drm_gem_object_lookup(file_priv, mode_cmd->handles[0]); if (!obj) diff --git a/drivers/gpu...
2018 Sep 05
0
[PATCH] bochs: convert to drm_fb_helper_fbdev_setup/teardown
...ruct drm_device *dev, > int bochs_dumb_mmap_offset(struct drm_file *file, struct drm_device *dev, > uint32_t handle, uint64_t *offset); > > -int bochs_framebuffer_init(struct drm_device *dev, > - struct bochs_framebuffer *gfb, > - const struct drm_mode_fb_cmd2 *mode_cmd, > - struct drm_gem_object *obj); > int bochs_bo_pin(struct bochs_bo *bo, u32 pl_flag, u64 *gpu_addr); > int bochs_bo_unpin(struct bochs_bo *bo); > > -extern const struct drm_mode_config_funcs bochs_mode_funcs; > - > /* bochs_kms.c */ > int bochs_kms_init(struct b...
2018 Dec 19
0
[PATCH 14/14] drm/bochs: move remaining fb bits to kms
...drm/drm_atomic_helper.h> -#include <drm/drm_gem_framebuffer_helper.h> - -/* ---------------------------------------------------------------------- */ - -static struct drm_framebuffer * -bochs_gem_fb_create(struct drm_device *dev, struct drm_file *file, - const struct drm_mode_fb_cmd2 *mode_cmd) -{ - if (mode_cmd->pixel_format != DRM_FORMAT_XRGB8888 && - mode_cmd->pixel_format != DRM_FORMAT_BGRX8888) - return ERR_PTR(-EINVAL); - - return drm_gem_fb_create(dev, file, mode_cmd); -} - -const struct drm_mode_config_funcs bochs_mode_funcs = { - .fb_create = bochs_gem_fb_crea...
2019 Dec 17
0
[PATCH v2 2/3] drm/nouveau: Check framebuffer size against bo
...%llu size=%lu\n", + offset, stride, h, tile_mode, bw, bh, gob_size, bl_size, + nvbo->bo.mem.size); + + if (bl_size + offset > nvbo->bo.mem.size) + return -ERANGE; + + return 0; +} + int nouveau_framebuffer_new(struct drm_device *dev, const struct drm_mode_fb_cmd2 *mode_cmd, @@ -232,6 +298,8 @@ nouveau_framebuffer_new(struct drm_device *dev, { struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_framebuffer *fb; + const struct drm_format_info *info; + unsigned int width, height, i; int ret; /* YUV overlays have special requirements pre-NV50 */...
2018 Dec 13
1
[PATCH] drm/virtio: switch to generic fbdev emulation
...r_surface_size *sizes) -{ - struct virtio_gpu_fbdev *vfbdev = - container_of(helper, struct virtio_gpu_fbdev, helper); - struct drm_device *dev = helper->dev; - struct virtio_gpu_device *vgdev = dev->dev_private; - struct fb_info *info; - struct drm_framebuffer *fb; - struct drm_mode_fb_cmd2 mode_cmd = {}; - struct virtio_gpu_object *obj; - uint32_t format, size; - int ret; - - mode_cmd.width = sizes->surface_width; - mode_cmd.height = sizes->surface_height; - mode_cmd.pitches[0] = mode_cmd.width * 4; - mode_cmd.pixel_format = DRM_FORMAT_HOST_XRGB8888; - - format = virtio_gpu_translate_fo...
2017 Apr 03
0
[PATCH 1/2] drm: virtio: add virtio_gpu_translate_format
...a/drivers/gpu/drm/virtio/virtgpu_fb.c b/drivers/gpu/drm/virtio/virtgpu_fb.c > index 9bfaef3..33df067 100644 > --- a/drivers/gpu/drm/virtio/virtgpu_fb.c > +++ b/drivers/gpu/drm/virtio/virtgpu_fb.c > @@ -231,63 +231,9 @@ static int virtio_gpufb_create(struct drm_fb_helper *helper, > mode_cmd.pitches[0] = mode_cmd.width * 4; > mode_cmd.pixel_format = drm_mode_legacy_fb_format(32, 24); > > - switch (mode_cmd.pixel_format) { > -#ifdef __BIG_ENDIAN > - case DRM_FORMAT_XRGB8888: > - format = VIRTIO_GPU_FORMAT_X8R8G8B8_UNORM; > - break; > - case DRM_FORMAT_ARGB8...
2018 Dec 12
0
[PATCH v2 18/18] drm/qxl: remove dead qxl fbdev emulation code
...qxlfb_destroy_pinned_object(struct drm_gem_object *gobj) -{ - struct qxl_bo *qbo = gem_to_qxl_bo(gobj); - - qxl_bo_kunmap(qbo); - qxl_bo_unpin(qbo); - - drm_gem_object_put_unlocked(gobj); -} - -static int qxlfb_create_pinned_object(struct qxl_device *qdev, - const struct drm_mode_fb_cmd2 *mode_cmd, - struct drm_gem_object **gobj_p) -{ - struct drm_gem_object *gobj = NULL; - struct qxl_bo *qbo = NULL; - int ret; - int aligned_size, size; - int height = mode_cmd->height; - - size = mode_cmd->pitches[0] * height; - aligned_size = ALIGN(size, PAGE_SIZE); - /* TODO: unallocate and...
2019 Dec 17
6
[PATCH v2 0/3] drm/nouveau: Support NVIDIA format modifiers
This series modifies the NV5x+ nouveau display backends to advertise appropriate format modifiers on their display planes in atomic mode setting blobs. Corresponding modifications to Mesa/userspace are available here: https://gitlab.freedesktop.org/cubanismo/mesa/tree/nouveau_work But those need a bit of cleanup before they're ready to submit. I've tested this on Tesla, Kepler, Pascal,
2017 Aug 06
4
[PATCH 0/4] Overlay / format improvements
This was all kicked off by me figuring out how the PPC byteswap thing worked. In the end, we're keeping the implicit byteswap based on architecture, but also expose the correctly supported formats, and fix some overlay details. Overlay framebuffers have various funky requirements that should be enforced at framebuffer creation time (these are set apart by their YUV formats). Further, I
2020 Feb 06
5
[PATCH 4/4] drm/nouveau: Remove struct nouveau_framebuffer
...eau/nouveau_display.c > index bbbff55eb5d5..94f7fd48e1cf 100644 > --- a/drivers/gpu/drm/nouveau/nouveau_display.c > +++ b/drivers/gpu/drm/nouveau/nouveau_display.c > @@ -207,10 +207,10 @@ int > nouveau_framebuffer_new(struct drm_device *dev, > const struct drm_mode_fb_cmd2 *mode_cmd, > struct drm_gem_object *gem, > - struct nouveau_framebuffer **pfb) > + struct drm_framebuffer **pfb) > { > struct nouveau_drm *drm = nouveau_drm(dev); > - struct nouveau_framebuffer *fb; > + struct drm_framebuffer *fb; > int ret; > > /*...