drm/virtio: clean up minor codestyle issues
Fix codestyle warnings and errors generated by CHECKPATCH in virtio source files. Signed-off-by: Athul Raj Kollareth <krathul3152@gmail.com> Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com> Link: https://lore.kernel.org/r/20250813062109.5326-1-krathul3152@gmail.com
This commit is contained in:
committed by
Dmitry Osipenko
parent
1e17ed8326
commit
38580d1e7f
@@ -131,9 +131,8 @@ static void virtio_gpu_crtc_atomic_flush(struct drm_crtc *crtc,
|
||||
* in the plane update callback, and here we just check
|
||||
* whenever we must force the modeset.
|
||||
*/
|
||||
if (drm_atomic_crtc_needs_modeset(crtc_state)) {
|
||||
if (drm_atomic_crtc_needs_modeset(crtc_state))
|
||||
output->needs_modeset = true;
|
||||
}
|
||||
}
|
||||
|
||||
static const struct drm_crtc_helper_funcs virtio_gpu_crtc_helper_funcs = {
|
||||
|
||||
@@ -162,18 +162,18 @@ int virtio_gpu_init(struct virtio_device *vdev, struct drm_device *dev)
|
||||
if (virtio_has_feature(vgdev->vdev, VIRTIO_GPU_F_VIRGL))
|
||||
vgdev->has_virgl_3d = true;
|
||||
#endif
|
||||
if (virtio_has_feature(vgdev->vdev, VIRTIO_GPU_F_EDID)) {
|
||||
if (virtio_has_feature(vgdev->vdev, VIRTIO_GPU_F_EDID))
|
||||
vgdev->has_edid = true;
|
||||
}
|
||||
if (virtio_has_feature(vgdev->vdev, VIRTIO_RING_F_INDIRECT_DESC)) {
|
||||
|
||||
if (virtio_has_feature(vgdev->vdev, VIRTIO_RING_F_INDIRECT_DESC))
|
||||
vgdev->has_indirect = true;
|
||||
}
|
||||
if (virtio_has_feature(vgdev->vdev, VIRTIO_GPU_F_RESOURCE_UUID)) {
|
||||
|
||||
if (virtio_has_feature(vgdev->vdev, VIRTIO_GPU_F_RESOURCE_UUID))
|
||||
vgdev->has_resource_assign_uuid = true;
|
||||
}
|
||||
if (virtio_has_feature(vgdev->vdev, VIRTIO_GPU_F_RESOURCE_BLOB)) {
|
||||
|
||||
if (virtio_has_feature(vgdev->vdev, VIRTIO_GPU_F_RESOURCE_BLOB))
|
||||
vgdev->has_resource_blob = true;
|
||||
}
|
||||
|
||||
if (virtio_get_shm_region(vgdev->vdev, &vgdev->host_visible_region,
|
||||
VIRTIO_GPU_SHM_ID_HOST_VISIBLE)) {
|
||||
if (!devm_request_mem_region(&vgdev->vdev->dev,
|
||||
@@ -193,9 +193,9 @@ int virtio_gpu_init(struct virtio_device *vdev, struct drm_device *dev)
|
||||
(unsigned long)vgdev->host_visible_region.addr,
|
||||
(unsigned long)vgdev->host_visible_region.len);
|
||||
}
|
||||
if (virtio_has_feature(vgdev->vdev, VIRTIO_GPU_F_CONTEXT_INIT)) {
|
||||
|
||||
if (virtio_has_feature(vgdev->vdev, VIRTIO_GPU_F_CONTEXT_INIT))
|
||||
vgdev->has_context_init = true;
|
||||
}
|
||||
|
||||
DRM_INFO("features: %cvirgl %cedid %cresource_blob %chost_visible",
|
||||
vgdev->has_virgl_3d ? '+' : '-',
|
||||
|
||||
@@ -47,6 +47,7 @@ int virtio_gpu_resource_id_get(struct virtio_gpu_device *vgdev, uint32_t *resid)
|
||||
*resid = handle + 1;
|
||||
} else {
|
||||
int handle = ida_alloc(&vgdev->resource_ida, GFP_KERNEL);
|
||||
|
||||
if (handle < 0)
|
||||
return handle;
|
||||
*resid = handle + 1;
|
||||
@@ -56,9 +57,8 @@ int virtio_gpu_resource_id_get(struct virtio_gpu_device *vgdev, uint32_t *resid)
|
||||
|
||||
static void virtio_gpu_resource_id_put(struct virtio_gpu_device *vgdev, uint32_t id)
|
||||
{
|
||||
if (!virtio_gpu_virglrenderer_workaround) {
|
||||
if (!virtio_gpu_virglrenderer_workaround)
|
||||
ida_free(&vgdev->resource_ida, id - 1);
|
||||
}
|
||||
}
|
||||
|
||||
void virtio_gpu_cleanup_object(struct virtio_gpu_object *bo)
|
||||
|
||||
@@ -120,7 +120,7 @@ static int virtio_gpu_plane_atomic_check(struct drm_plane *plane,
|
||||
crtc_state = drm_atomic_get_crtc_state(state,
|
||||
new_plane_state->crtc);
|
||||
if (IS_ERR(crtc_state))
|
||||
return PTR_ERR(crtc_state);
|
||||
return PTR_ERR(crtc_state);
|
||||
|
||||
ret = drm_atomic_helper_check_plane_state(new_plane_state, crtc_state,
|
||||
DRM_PLANE_NO_SCALING,
|
||||
|
||||
@@ -248,6 +248,7 @@ void virtio_gpu_dequeue_ctrl_func(struct work_struct *work)
|
||||
if (resp->type != cpu_to_le32(VIRTIO_GPU_RESP_OK_NODATA)) {
|
||||
if (le32_to_cpu(resp->type) >= VIRTIO_GPU_RESP_ERR_UNSPEC) {
|
||||
struct virtio_gpu_ctrl_hdr *cmd;
|
||||
|
||||
cmd = virtio_gpu_vbuf_ctrl_hdr(entry);
|
||||
DRM_ERROR_RATELIMITED("response 0x%x (command 0x%x)\n",
|
||||
le32_to_cpu(resp->type),
|
||||
@@ -468,6 +469,7 @@ static int virtio_gpu_queue_fenced_ctrl_buffer(struct virtio_gpu_device *vgdev,
|
||||
if (vbuf->data_size) {
|
||||
if (is_vmalloc_addr(vbuf->data_buf)) {
|
||||
int sg_ents;
|
||||
|
||||
sgt = vmalloc_to_sgt(vbuf->data_buf, vbuf->data_size,
|
||||
&sg_ents);
|
||||
if (!sgt) {
|
||||
|
||||
Reference in New Issue
Block a user