mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 23:03:57 -04:00
drm/virtio: Pass along the format info from .fb_create() to drm_helper_mode_fill_fb_struct()
Plumb the format info from .fb_create() all the way to drm_helper_mode_fill_fb_struct() to avoid the redundant lookup. Cc: David Airlie <airlied@redhat.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Dmitry Osipenko <dmitry.osipenko@collabora.com> Cc: Gurchetan Singh <gurchetansingh@chromium.org> Cc: Chia-I Wu <olvaffe@gmail.com> Cc: virtualization@lists.linux.dev Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Acked-by: Dmitry Osipenko <dmitry.osipenko@collabora.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250701090722.13645-18-ville.syrjala@linux.intel.com
This commit is contained in:
@@ -66,6 +66,7 @@ static const struct drm_framebuffer_funcs virtio_gpu_fb_funcs = {
|
||||
static int
|
||||
virtio_gpu_framebuffer_init(struct drm_device *dev,
|
||||
struct virtio_gpu_framebuffer *vgfb,
|
||||
const struct drm_format_info *info,
|
||||
const struct drm_mode_fb_cmd2 *mode_cmd,
|
||||
struct drm_gem_object *obj)
|
||||
{
|
||||
@@ -73,7 +74,7 @@ virtio_gpu_framebuffer_init(struct drm_device *dev,
|
||||
|
||||
vgfb->base.obj[0] = obj;
|
||||
|
||||
drm_helper_mode_fill_fb_struct(dev, &vgfb->base, NULL, mode_cmd);
|
||||
drm_helper_mode_fill_fb_struct(dev, &vgfb->base, info, mode_cmd);
|
||||
|
||||
ret = drm_framebuffer_init(dev, &vgfb->base, &virtio_gpu_fb_funcs);
|
||||
if (ret) {
|
||||
@@ -315,7 +316,7 @@ virtio_gpu_user_framebuffer_create(struct drm_device *dev,
|
||||
return ERR_PTR(-ENOMEM);
|
||||
}
|
||||
|
||||
ret = virtio_gpu_framebuffer_init(dev, virtio_gpu_fb, mode_cmd, obj);
|
||||
ret = virtio_gpu_framebuffer_init(dev, virtio_gpu_fb, info, mode_cmd, obj);
|
||||
if (ret) {
|
||||
kfree(virtio_gpu_fb);
|
||||
drm_gem_object_put(obj);
|
||||
|
||||
Reference in New Issue
Block a user