Displaying 20 results from an estimated 60 matches for "num_scanouts".
2023 Feb 28
2
[PATCH v3] drm/virtio: Add option to disable KMS support
...>> On 2/27/23 20:38, Rob Clark wrote:
>> ...
>>> + if (IS_ENABLED(CONFIG_DRM_VIRTIO_GPU_KMS)) {
>>> + /* get display info */
>>> + virtio_cread_le(vgdev->vdev, struct virtio_gpu_config,
>>> + num_scanouts, &num_scanouts);
>>> + vgdev->num_scanouts = min_t(uint32_t, num_scanouts,
>>> + VIRTIO_GPU_MAX_SCANOUTS);
>>> + if (!vgdev->num_scanouts) {
>>> + /*
>>> +...
2023 Feb 27
1
[PATCH v3] drm/virtio: Add option to disable KMS support
....com> wrote:
>
> On 2/27/23 20:38, Rob Clark wrote:
> ...
> > + if (IS_ENABLED(CONFIG_DRM_VIRTIO_GPU_KMS)) {
> > + /* get display info */
> > + virtio_cread_le(vgdev->vdev, struct virtio_gpu_config,
> > + num_scanouts, &num_scanouts);
> > + vgdev->num_scanouts = min_t(uint32_t, num_scanouts,
> > + VIRTIO_GPU_MAX_SCANOUTS);
> > + if (!vgdev->num_scanouts) {
> > + /*
> > +...
2023 Mar 01
1
[PATCH v5] drm/virtio: Add option to disable KMS support
...happened in the past, we should assume it will
again in the future), it makes sense to have a build option to disable
those ioctls in cases where they serve no legitimate purpose.
v2: Use more if (IS_ENABLED(...))
v3: Also permit the host to advertise no scanouts
v4: Spiff out commit msg
v5: Make num_scanouts==0 and DRM_VIRTIO_GPU_KMS=n behave the same
Signed-off-by: Rob Clark <robdclark at chromium.org>
Reviewed-by: Dmitry Osipenko <dmitry.osipenko at collabora.com>
Reviewed-by: Javier Martinez Canillas <javierm at redhat.com>
---
drivers/gpu/drm/virtio/Kconfig | 11 ++++++++++...
2020 Aug 05
1
[PATCH v3 34/38] drm/virtio: convert to LE accessors
...;vdev, struct virtio_gpu_config,
+ events_clear, &events_clear);
}
static void virtio_gpu_init_vq(struct virtio_gpu_queue *vgvq,
@@ -165,8 +165,8 @@ int virtio_gpu_init(struct drm_device *dev)
}
/* get display info */
- virtio_cread(vgdev->vdev, struct virtio_gpu_config,
- num_scanouts, &num_scanouts);
+ virtio_cread_le(vgdev->vdev, struct virtio_gpu_config,
+ num_scanouts, &num_scanouts);
vgdev->num_scanouts = min_t(uint32_t, num_scanouts,
VIRTIO_GPU_MAX_SCANOUTS);
if (!vgdev->num_scanouts) {
@@ -176,8 +176,8 @@ int virtio_gpu_init(struct drm_devi...
2023 Mar 06
0
[PATCH v1] drm/virtio: Fix handling CONFIG_DRM_VIRTIO_GPU_KMS option
..._struct *work)
> if (events_read & VIRTIO_GPU_EVENT_DISPLAY) {
> if (vgdev->has_edid)
> virtio_gpu_cmd_get_edids(vgdev);
> - virtio_gpu_cmd_get_display_info(vgdev);
> - virtio_gpu_notify(vgdev);
> - drm_helper_hpd_irq_event(vgdev->ddev);
> + if (vgdev->num_scanouts) {
> + virtio_gpu_cmd_get_display_info(vgdev);
> + virtio_gpu_notify(vgdev);
> + drm_helper_hpd_irq_event(vgdev->ddev);
> + }
I'd suggest to make the edid lines conditional too.
> - if (IS_ENABLED(CONFIG_DRM_VIRTIO_GPU_KMS) || !vgdev->num_scanouts) {
> + if (!IS...
2023 Feb 24
2
[PATCH] drm/virtio: Add option to disable KMS support
...DIRECT_DESC)) {
vgdev->has_indirect = true;
}
@@ -218,6 +220,7 @@ int virtio_gpu_init(struct virtio_device *vdev, struct drm_device *dev)
goto err_vbufs;
}
+#if defined(CONFIG_DRM_VIRTIO_GPU_KMS)
/* get display info */
virtio_cread_le(vgdev->vdev, struct virtio_gpu_config,
num_scanouts, &num_scanouts);
@@ -229,6 +232,7 @@ int virtio_gpu_init(struct virtio_device *vdev, struct drm_device *dev)
goto err_scanouts;
}
DRM_INFO("number of scanouts: %d\n", num_scanouts);
+#endif
virtio_cread_le(vgdev->vdev, struct virtio_gpu_config,
num_capsets, &num_...
2019 Apr 01
1
[PATCH 1/3] drm/virtio: add missing drm_atomic_helper_shutdown() call.
...play.c b/drivers/gpu/drm/virtio/virtgpu_display.c
index 653ec7d0bf4d..86843a4d6102 100644
--- a/drivers/gpu/drm/virtio/virtgpu_display.c
+++ b/drivers/gpu/drm/virtio/virtgpu_display.c
@@ -385,5 +385,6 @@ void virtio_gpu_modeset_fini(struct virtio_gpu_device *vgdev)
for (i = 0 ; i < vgdev->num_scanouts; ++i)
kfree(vgdev->outputs[i].edid);
+ drm_atomic_helper_shutdown(vgdev->ddev);
drm_mode_config_cleanup(vgdev->ddev);
}
--
2.18.1
2020 Aug 03
0
[PATCH v2 10/24] virtio_gpu: correct tags for config space fields
...h
index 0c85914d9369..ccbd174ef321 100644
--- a/include/uapi/linux/virtio_gpu.h
+++ b/include/uapi/linux/virtio_gpu.h
@@ -320,10 +320,10 @@ struct virtio_gpu_resp_edid {
#define VIRTIO_GPU_EVENT_DISPLAY (1 << 0)
struct virtio_gpu_config {
- __u32 events_read;
- __u32 events_clear;
- __u32 num_scanouts;
- __u32 num_capsets;
+ __le32 events_read;
+ __le32 events_clear;
+ __le32 num_scanouts;
+ __le32 num_capsets;
};
/* simple formats for fbcon/X use */
--
MST
2020 Aug 05
1
[PATCH v3 10/38] virtio_gpu: correct tags for config space fields
...h
index 0c85914d9369..ccbd174ef321 100644
--- a/include/uapi/linux/virtio_gpu.h
+++ b/include/uapi/linux/virtio_gpu.h
@@ -320,10 +320,10 @@ struct virtio_gpu_resp_edid {
#define VIRTIO_GPU_EVENT_DISPLAY (1 << 0)
struct virtio_gpu_config {
- __u32 events_read;
- __u32 events_clear;
- __u32 num_scanouts;
- __u32 num_capsets;
+ __le32 events_read;
+ __le32 events_clear;
+ __le32 num_scanouts;
+ __le32 num_capsets;
};
/* simple formats for fbcon/X use */
--
MST
2020 Feb 07
1
[PATCH v2] drm/virtio: fix ring free check
...d_bool(m, "virgl", vgdev->has_virgl_3d);
virtio_add_bool(m, "edid", vgdev->has_edid);
+ virtio_add_bool(m, "indirect", vgdev->has_indirect);
virtio_add_int(m, "cap sets", vgdev->num_capsets);
virtio_add_int(m, "scanouts", vgdev->num_scanouts);
return 0;
diff --git a/drivers/gpu/drm/virtio/virtgpu_kms.c b/drivers/gpu/drm/virtio/virtgpu_kms.c
index 2f5773e43557..c1086df49816 100644
--- a/drivers/gpu/drm/virtio/virtgpu_kms.c
+++ b/drivers/gpu/drm/virtio/virtgpu_kms.c
@@ -159,6 +159,9 @@ int virtio_gpu_init(struct drm_device *dev)
if (...
2018 Sep 13
0
[PATCH 3/3] drm/virtio: add edid support
...uf)
+{
+ struct virtio_gpu_resp_edid *resp =
+ (struct virtio_gpu_resp_edid *)vbuf->resp_buf;
+ uint32_t scanout = le32_to_cpu(resp->scanout);
+ uint32_t size = le32_to_cpu(resp->size);
+ struct virtio_gpu_output *output;
+ struct edid *new_edid, *old_edid;
+
+ if (scanout >= vgdev->num_scanouts)
+ return;
+ output = vgdev->outputs + scanout;
+
+ if (drm_edid_is_valid((struct edid *)resp->edid)) {
+ new_edid = kmalloc(size, GFP_KERNEL);
+ memcpy(new_edid, resp->edid, size);
+ } else {
+ new_edid = NULL;
+ }
+
+ spin_lock(&vgdev->display_info_lock);
+ old_edid = output-&...
2014 Sep 11
0
[PATCH 2/2] virtio-gpu/2d: add docs/specs/virtio-gpu.txt
...re cursors and multiple scanouts (aka heads).
+
+
+features
+--------
+
+There are no feature bits (yet).
+There will be one in the future for 3D mode support.
+
+
+config space
+------------
+
+struct virtgpu_config {
+ uint32_t events_read;
+ uint32_t events_clear;
+ uint32_t num_scanouts;
+ uint32_t reserved;
+};
+
+The two members events_read and events_clear are used to signal events
+to the driver. Currently one event is defined for a display
+change. When a config space interrupt is received the driver should
+read the events_read field. The events processed should be...
2017 May 24
2
[PATCH 02/37] drm: Remove drm_device->virtdev
...drivers/gpu/drm/virtio/virtgpu_kms.c b/drivers/gpu/drm/virtio/virtgpu_kms.c
index 1e1c90b30d4a..6400506a06b0 100644
--- a/drivers/gpu/drm/virtio/virtgpu_kms.c
+++ b/drivers/gpu/drm/virtio/virtgpu_kms.c
@@ -138,7 +138,7 @@ int virtio_gpu_driver_load(struct drm_device *dev, unsigned long flags)
u32 num_scanouts, num_capsets;
int ret;
- if (!virtio_has_feature(dev->virtdev, VIRTIO_F_VERSION_1))
+ if (!virtio_has_feature(dev_to_virtio(dev->dev), VIRTIO_F_VERSION_1))
return -ENODEV;
vgdev = kzalloc(sizeof(struct virtio_gpu_device), GFP_KERNEL);
@@ -147,7 +147,7 @@ int virtio_gpu_driver_load(...
2017 May 24
2
[PATCH 02/37] drm: Remove drm_device->virtdev
...drivers/gpu/drm/virtio/virtgpu_kms.c b/drivers/gpu/drm/virtio/virtgpu_kms.c
index 1e1c90b30d4a..6400506a06b0 100644
--- a/drivers/gpu/drm/virtio/virtgpu_kms.c
+++ b/drivers/gpu/drm/virtio/virtgpu_kms.c
@@ -138,7 +138,7 @@ int virtio_gpu_driver_load(struct drm_device *dev, unsigned long flags)
u32 num_scanouts, num_capsets;
int ret;
- if (!virtio_has_feature(dev->virtdev, VIRTIO_F_VERSION_1))
+ if (!virtio_has_feature(dev_to_virtio(dev->dev), VIRTIO_F_VERSION_1))
return -ENODEV;
vgdev = kzalloc(sizeof(struct virtio_gpu_device), GFP_KERNEL);
@@ -147,7 +147,7 @@ int virtio_gpu_driver_load(...
2015 Mar 24
10
[PATCH] Add virtio gpu driver.
...e validated against the framebuffer size */
+ vgdev->ddev->mode_config.min_width = XRES_MIN;
+ vgdev->ddev->mode_config.min_height = YRES_MIN;
+ vgdev->ddev->mode_config.max_width = XRES_MAX;
+ vgdev->ddev->mode_config.max_height = YRES_MAX;
+
+ for (i = 0 ; i < vgdev->num_scanouts; ++i)
+ vgdev_output_init(vgdev, i);
+
+ /* primary surface must be created by this point, to allow
+ * issuing command queue commands and having them read by
+ * spice server. */
+ ret = virtio_gpu_fbdev_init(vgdev);
+ if (ret)
+ return ret;
+
+ ret = drm_vblank_init(vgdev->ddev, vgdev->...
2015 Mar 24
10
[PATCH] Add virtio gpu driver.
...e validated against the framebuffer size */
+ vgdev->ddev->mode_config.min_width = XRES_MIN;
+ vgdev->ddev->mode_config.min_height = YRES_MIN;
+ vgdev->ddev->mode_config.max_width = XRES_MAX;
+ vgdev->ddev->mode_config.max_height = YRES_MAX;
+
+ for (i = 0 ; i < vgdev->num_scanouts; ++i)
+ vgdev_output_init(vgdev, i);
+
+ /* primary surface must be created by this point, to allow
+ * issuing command queue commands and having them read by
+ * spice server. */
+ ret = virtio_gpu_fbdev_init(vgdev);
+ if (ret)
+ return ret;
+
+ ret = drm_vblank_init(vgdev->ddev, vgdev->...
2015 Mar 24
0
[PATCH] Add virtio gpu driver.
...uffer size */
> + vgdev->ddev->mode_config.min_width = XRES_MIN;
> + vgdev->ddev->mode_config.min_height = YRES_MIN;
> + vgdev->ddev->mode_config.max_width = XRES_MAX;
> + vgdev->ddev->mode_config.max_height = YRES_MAX;
> +
> + for (i = 0 ; i < vgdev->num_scanouts; ++i)
> + vgdev_output_init(vgdev, i);
> +
> + /* primary surface must be created by this point, to allow
> + * issuing command queue commands and having them read by
> + * spice server. */
> + ret = virtio_gpu_fbdev_init(vgdev);
> + if (ret)
> + return ret;
> +
>...
2015 Mar 24
0
[PATCH] Add virtio gpu driver.
...uffer size */
> + vgdev->ddev->mode_config.min_width = XRES_MIN;
> + vgdev->ddev->mode_config.min_height = YRES_MIN;
> + vgdev->ddev->mode_config.max_width = XRES_MAX;
> + vgdev->ddev->mode_config.max_height = YRES_MAX;
> +
> + for (i = 0 ; i < vgdev->num_scanouts; ++i)
> + vgdev_output_init(vgdev, i);
> +
> + /* primary surface must be created by this point, to allow
> + * issuing command queue commands and having them read by
> + * spice server. */
> + ret = virtio_gpu_fbdev_init(vgdev);
> + if (ret)
> + return ret;
> +
>...
2020 Feb 10
1
[PATCH v2] drm/virtio: add drm_driver.release callback.
...play.c b/drivers/gpu/drm/virtio/virtgpu_display.c
index 7b0f0643bb2d..af953db4a0c9 100644
--- a/drivers/gpu/drm/virtio/virtgpu_display.c
+++ b/drivers/gpu/drm/virtio/virtgpu_display.c
@@ -368,6 +368,5 @@ void virtio_gpu_modeset_fini(struct virtio_gpu_device *vgdev)
for (i = 0 ; i < vgdev->num_scanouts; ++i)
kfree(vgdev->outputs[i].edid);
- drm_atomic_helper_shutdown(vgdev->ddev);
drm_mode_config_cleanup(vgdev->ddev);
}
diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.c b/drivers/gpu/drm/virtio/virtgpu_drv.c
index 8cf27af3ad53..664a741a3b0b 100644
--- a/drivers/gpu/drm/virtio/virtgp...
2018 Dec 13
1
[PATCH] drm/virtio: switch to generic fbdev emulation
...struct virtio_gpu_queue {
struct virtqueue *vq;
spinlock_t qlock;
@@ -180,8 +171,6 @@ struct virtio_gpu_device {
struct virtio_gpu_mman mman;
- /* pointer to fbdev info structure */
- struct virtio_gpu_fbdev *vgfbdev;
struct virtio_gpu_output outputs[VIRTIO_GPU_MAX_SCANOUTS];
uint32_t num_scanouts;
@@ -249,9 +238,6 @@ int virtio_gpu_mode_dumb_mmap(struct drm_file *file_priv,
uint32_t handle, uint64_t *offset_p);
/* virtio_fb */
-#define VIRTIO_GPUFB_CONN_LIMIT 1
-int virtio_gpu_fbdev_init(struct virtio_gpu_device *vgdev);
-void virtio_gpu_fbdev_fini(struct virtio_gpu_device *v...