drm/virtio: switch to struct drm_edid
Prefer struct drm_edid based functions over struct edid. Signed-off-by: Jani Nikula <jani.nikula@intel.com> Reviewed-by: Robert Foss <rfoss@kernel.org> Signed-off-by: Robert Foss <rfoss@kernel.org> Link: https://patchwork.freedesktop.org/patch/msgid/ed6e76a9e94816789ca9caf8775d6a6156877496.1715347488.git.jani.nikula@intel.com
This commit is contained in:
@@ -164,11 +164,9 @@ static int virtio_gpu_conn_get_modes(struct drm_connector *connector)
|
||||
struct drm_display_mode *mode = NULL;
|
||||
int count, width, height;
|
||||
|
||||
if (output->edid) {
|
||||
count = drm_add_edid_modes(connector, output->edid);
|
||||
if (count)
|
||||
return count;
|
||||
}
|
||||
count = drm_edid_connector_add_modes(connector);
|
||||
if (count)
|
||||
return count;
|
||||
|
||||
width = le32_to_cpu(output->info.r.width);
|
||||
height = le32_to_cpu(output->info.r.height);
|
||||
@@ -369,5 +367,5 @@ void virtio_gpu_modeset_fini(struct virtio_gpu_device *vgdev)
|
||||
return;
|
||||
|
||||
for (i = 0 ; i < vgdev->num_scanouts; ++i)
|
||||
kfree(vgdev->outputs[i].edid);
|
||||
drm_edid_free(vgdev->outputs[i].drm_edid);
|
||||
}
|
||||
|
||||
@@ -179,7 +179,7 @@ struct virtio_gpu_output {
|
||||
struct drm_encoder enc;
|
||||
struct virtio_gpu_display_one info;
|
||||
struct virtio_gpu_update_cursor cursor;
|
||||
struct edid *edid;
|
||||
const struct drm_edid *drm_edid;
|
||||
int cur_x;
|
||||
int cur_y;
|
||||
bool needs_modeset;
|
||||
|
||||
@@ -741,21 +741,21 @@ static void virtio_gpu_cmd_get_edid_cb(struct virtio_gpu_device *vgdev,
|
||||
(struct virtio_gpu_resp_edid *)vbuf->resp_buf;
|
||||
uint32_t scanout = le32_to_cpu(cmd->scanout);
|
||||
struct virtio_gpu_output *output;
|
||||
struct edid *new_edid, *old_edid;
|
||||
const struct drm_edid *new_edid, *old_edid;
|
||||
|
||||
if (scanout >= vgdev->num_scanouts)
|
||||
return;
|
||||
output = vgdev->outputs + scanout;
|
||||
|
||||
new_edid = drm_do_get_edid(&output->conn, virtio_get_edid_block, resp);
|
||||
drm_connector_update_edid_property(&output->conn, new_edid);
|
||||
new_edid = drm_edid_read_custom(&output->conn, virtio_get_edid_block, resp);
|
||||
drm_edid_connector_update(&output->conn, new_edid);
|
||||
|
||||
spin_lock(&vgdev->display_info_lock);
|
||||
old_edid = output->edid;
|
||||
output->edid = new_edid;
|
||||
old_edid = output->drm_edid;
|
||||
output->drm_edid = new_edid;
|
||||
spin_unlock(&vgdev->display_info_lock);
|
||||
|
||||
kfree(old_edid);
|
||||
drm_edid_free(old_edid);
|
||||
wake_up(&vgdev->resp_wq);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user