Call for Papers - WorldCIST'19 - La Toja Island, Spain

2018-10-19 Thread Maria Lemos
*** Best papers published in JCR/SCI/SSCI journals



---
WorldCIST'19 - 7th World Conference on Information Systems and Technologies

16 - 19 April 2019 | La Toja Island, Spain

http://www.worldcist.org/ 

----
----


Scope

The WorldCist'19 - 7th World Conference on Information Systems and 
Technologies, to be held at La Toja Island, Galicia, Spain, 16 - 19 April 2019, 
is a global forum for researchers and practitioners to present and discuss the 
most recent innovations, trends, results, experiences and concerns in the 
several perspectives of Information Systems and Technologies.

We are pleased to invite you to submit your papers to WorldCist'18. All 
submissions will be reviewed on the basis of relevance, originality, importance 
and clarity.



Themes

Submitted papers should be related with one or more of the main themes proposed 
for the Conference:

A) Information and Knowledge Management (IKM);

B) Organizational Models and Information Systems (OMIS);

C) Software and Systems Modeling (SSM);

D) Software Systems, Architectures, Applications and Tools (SSAAT);

E) Multimedia Systems and Applications (MSA);

F) Computer Networks, Mobility and Pervasive Systems (CNMPS);

G) Intelligent and Decision Support Systems (IDSS);

H) Big Data Analytics and Applications (BDAA);

I) Human-Computer Interaction (HCI);

J) Ethics, Computers and Security (ECS)

K) Health Informatics (HIS);

L) Information Technologies in Education (ITE);

M) Information Technologies in Radiocommunications (ITR);

N) Technologies for Biomedical Applications (TBA)



Types of Submissions and Decisions

Four types of papers can be submitted:

Full paper: Finished or consolidated R works, to be included in one of the 
Conference themes. These papers are assigned a 10-page limit.

Short paper: Ongoing works with relevant preliminary results, open to 
discussion. These papers are assigned a 7-page limit.

Poster paper: Initial work with relevant ideas, open to discussion. These 
papers are assigned to a 4-page limit.

Company paper: Companies' papers that show practical experience, R & D, tools, 
etc., focused on some topics of the conference. These papers are assigned to a 
4-page limit.

Submitted papers must comply with the format of Advances in Intelligent Systems 
and Computing Series (see Instructions for Authors at Springer Website 

 or download a Word Template 
or 
Latex Package 
) 
be written in English, must not have been published before, not be under review 
for any other conference or publication and not include any information leading 
to the authors’ identification. Therefore, the authors’ names, affiliations and 
bibliographic references should not be included in the version for evaluation 
by the Program Committee. This information should only be included in the 
camera-ready version, saved in Word or Latex format and also in PDF format. 
These files must be accompanied by the Consent to Publish form 
 filled out, in a ZIP file, and uploaded at 
the conference management system.


All papers will be subjected to a “double-blind review” by at least two members 
of the Program Committee.

Based on Program Committee evaluation, a paper can be rejected or accepted by 
the Conference Chairs. In the later case, it can be accepted as the type 
originally submitted or as another type. Thus, full papers can be accepted as 
short papers or poster papers only. Similarly, short papers can be accepted as 
poster papers only. In these cases, the authors will be allowed to maintain the 
original number of pages in the camera-ready version.

The authors of accepted poster papers must also build and print a poster to be 
exhibited during the Conference. This poster must follow an A1 or A2 vertical 
format. The Conference can includes Work Sessions where these posters are 
presented and orally discussed, with a 5 minute limit per poster.

The authors of accepted full papers will have 15 minutes to present their work 
in a Conference Work Session; approximately 5 minutes of discussion will follow 
each presentation. The authors of accepted short papers and company papers will 
have 11 minutes to present their work in a Conference Work Session; 
approximately 4 minutes of discussion will follow each presentation.



Publication and Indexing

To ensure that a full paper, short paper, poster paper or company paper is 
published, at least one of the authors must be fully registered by the 13th of 
January 2019, and the paper must comply with the suggested layout and 

[PATCH v2 1/6] drm/virtio: track created object state

2018-10-19 Thread Gerd Hoffmann
Track whenever the virtio_gpu_object is already created (i.e. host knows
about it) in a new variable.  Add checks to virtio_gpu_object_attach()
to do nothing on objects not created yet.

Make virtio_gpu_ttm_bo_destroy() use the new variable too, instead of
expecting hw_res_handle indicating the object state.

Signed-off-by: Gerd Hoffmann 
---
 drivers/gpu/drm/virtio/virtgpu_drv.h| 3 +++
 drivers/gpu/drm/virtio/virtgpu_fb.c | 2 +-
 drivers/gpu/drm/virtio/virtgpu_gem.c| 3 ++-
 drivers/gpu/drm/virtio/virtgpu_ioctl.c  | 4 ++--
 drivers/gpu/drm/virtio/virtgpu_object.c | 2 +-
 drivers/gpu/drm/virtio/virtgpu_vq.c | 7 +++
 6 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.h 
b/drivers/gpu/drm/virtio/virtgpu_drv.h
index d29f0c7c76..5edc22d7a7 100644
--- a/drivers/gpu/drm/virtio/virtgpu_drv.h
+++ b/drivers/gpu/drm/virtio/virtgpu_drv.h
@@ -65,6 +65,7 @@ struct virtio_gpu_object {
struct ttm_placementplacement;
struct ttm_buffer_objecttbo;
struct ttm_bo_kmap_obj  kmap;
+   bool created;
 };
 #define gem_to_virtio_gpu_obj(gobj) \
container_of((gobj), struct virtio_gpu_object, gem_base)
@@ -263,6 +264,7 @@ void virtio_gpu_resource_id_get(struct virtio_gpu_device 
*vgdev,
   uint32_t *resid);
 void virtio_gpu_resource_id_put(struct virtio_gpu_device *vgdev, uint32_t id);
 void virtio_gpu_cmd_create_resource(struct virtio_gpu_device *vgdev,
+   struct virtio_gpu_object *bo,
uint32_t resource_id,
uint32_t format,
uint32_t width,
@@ -324,6 +326,7 @@ void virtio_gpu_cmd_transfer_to_host_3d(struct 
virtio_gpu_device *vgdev,
struct virtio_gpu_fence **fence);
 void
 virtio_gpu_cmd_resource_create_3d(struct virtio_gpu_device *vgdev,
+ struct virtio_gpu_object *bo,
  struct virtio_gpu_resource_create_3d *rc_3d,
  struct virtio_gpu_fence **fence);
 void virtio_gpu_ctrl_ack(struct virtqueue *vq);
diff --git a/drivers/gpu/drm/virtio/virtgpu_fb.c 
b/drivers/gpu/drm/virtio/virtgpu_fb.c
index cea749f4ec..d39f4f3350 100644
--- a/drivers/gpu/drm/virtio/virtgpu_fb.c
+++ b/drivers/gpu/drm/virtio/virtgpu_fb.c
@@ -232,7 +232,7 @@ static int virtio_gpufb_create(struct drm_fb_helper *helper,
return PTR_ERR(obj);
 
virtio_gpu_resource_id_get(vgdev, );
-   virtio_gpu_cmd_create_resource(vgdev, resid, format,
+   virtio_gpu_cmd_create_resource(vgdev, obj, resid, format,
   mode_cmd.width, mode_cmd.height);
 
ret = virtio_gpu_object_kmap(obj);
diff --git a/drivers/gpu/drm/virtio/virtgpu_gem.c 
b/drivers/gpu/drm/virtio/virtgpu_gem.c
index 82c817f37c..33dbd5aed7 100644
--- a/drivers/gpu/drm/virtio/virtgpu_gem.c
+++ b/drivers/gpu/drm/virtio/virtgpu_gem.c
@@ -103,8 +103,9 @@ int virtio_gpu_mode_dumb_create(struct drm_file *file_priv,
goto fail;
 
format = virtio_gpu_translate_format(DRM_FORMAT_HOST_XRGB);
+   obj = gem_to_virtio_gpu_obj(gobj);
virtio_gpu_resource_id_get(vgdev, );
-   virtio_gpu_cmd_create_resource(vgdev, resid, format,
+   virtio_gpu_cmd_create_resource(vgdev, obj, resid, format,
   args->width, args->height);
 
/* attach the object to the resource */
diff --git a/drivers/gpu/drm/virtio/virtgpu_ioctl.c 
b/drivers/gpu/drm/virtio/virtgpu_ioctl.c
index f16b875d6a..98bb238e91 100644
--- a/drivers/gpu/drm/virtio/virtgpu_ioctl.c
+++ b/drivers/gpu/drm/virtio/virtgpu_ioctl.c
@@ -260,7 +260,7 @@ static int virtio_gpu_resource_create_ioctl(struct 
drm_device *dev, void *data,
obj = >gem_base;
 
if (!vgdev->has_virgl_3d) {
-   virtio_gpu_cmd_create_resource(vgdev, res_id, rc->format,
+   virtio_gpu_cmd_create_resource(vgdev, qobj, res_id, rc->format,
   rc->width, rc->height);
 
ret = virtio_gpu_object_attach(vgdev, qobj, res_id, NULL);
@@ -288,7 +288,7 @@ static int virtio_gpu_resource_create_ioctl(struct 
drm_device *dev, void *data,
rc_3d.nr_samples = cpu_to_le32(rc->nr_samples);
rc_3d.flags = cpu_to_le32(rc->flags);
 
-   virtio_gpu_cmd_resource_create_3d(vgdev, _3d, NULL);
+   virtio_gpu_cmd_resource_create_3d(vgdev, qobj, _3d, NULL);
ret = virtio_gpu_object_attach(vgdev, qobj, res_id, );
if (ret) {
ttm_eu_backoff_reservation(, _list);
diff --git a/drivers/gpu/drm/virtio/virtgpu_object.c 
b/drivers/gpu/drm/virtio/virtgpu_object.c
index eca7655374..6611c487d7 100644
--- a/drivers/gpu/drm/virtio/virtgpu_object.c
+++ 

[PATCH v2 5/6] drm/virtio: drop resource_id argument.

2018-10-19 Thread Gerd Hoffmann
We pass the obj anyway, so obj->hw_res_handle can be used instead
in virtio_gpu_object_attach() and virtio_gpu_cmd_create_resource().

Signed-off-by: Gerd Hoffmann 
---
 drivers/gpu/drm/virtio/virtgpu_drv.h   | 2 --
 drivers/gpu/drm/virtio/virtgpu_fb.c| 4 ++--
 drivers/gpu/drm/virtio/virtgpu_gem.c   | 4 ++--
 drivers/gpu/drm/virtio/virtgpu_ioctl.c | 6 +++---
 drivers/gpu/drm/virtio/virtgpu_ttm.c   | 3 +--
 drivers/gpu/drm/virtio/virtgpu_vq.c| 7 ++-
 6 files changed, 10 insertions(+), 16 deletions(-)

diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.h 
b/drivers/gpu/drm/virtio/virtgpu_drv.h
index 5edc22d7a7..c6b0a938ba 100644
--- a/drivers/gpu/drm/virtio/virtgpu_drv.h
+++ b/drivers/gpu/drm/virtio/virtgpu_drv.h
@@ -265,7 +265,6 @@ void virtio_gpu_resource_id_get(struct virtio_gpu_device 
*vgdev,
 void virtio_gpu_resource_id_put(struct virtio_gpu_device *vgdev, uint32_t id);
 void virtio_gpu_cmd_create_resource(struct virtio_gpu_device *vgdev,
struct virtio_gpu_object *bo,
-   uint32_t resource_id,
uint32_t format,
uint32_t width,
uint32_t height);
@@ -287,7 +286,6 @@ void virtio_gpu_cmd_set_scanout(struct virtio_gpu_device 
*vgdev,
uint32_t x, uint32_t y);
 int virtio_gpu_object_attach(struct virtio_gpu_device *vgdev,
 struct virtio_gpu_object *obj,
-uint32_t resource_id,
 struct virtio_gpu_fence **fence);
 void virtio_gpu_object_detach(struct virtio_gpu_device *vgdev,
  struct virtio_gpu_object *obj);
diff --git a/drivers/gpu/drm/virtio/virtgpu_fb.c 
b/drivers/gpu/drm/virtio/virtgpu_fb.c
index 800960bdd9..c22a8246b6 100644
--- a/drivers/gpu/drm/virtio/virtgpu_fb.c
+++ b/drivers/gpu/drm/virtio/virtgpu_fb.c
@@ -232,7 +232,7 @@ static int virtio_gpufb_create(struct drm_fb_helper *helper,
return PTR_ERR(obj);
 
virtio_gpu_resource_id_get(vgdev, >hw_res_handle);
-   virtio_gpu_cmd_create_resource(vgdev, obj, obj->hw_res_handle, format,
+   virtio_gpu_cmd_create_resource(vgdev, obj, format,
   mode_cmd.width, mode_cmd.height);
 
ret = virtio_gpu_object_kmap(obj);
@@ -242,7 +242,7 @@ static int virtio_gpufb_create(struct drm_fb_helper *helper,
}
 
/* attach the object to the resource */
-   ret = virtio_gpu_object_attach(vgdev, obj, obj->hw_res_handle, NULL);
+   ret = virtio_gpu_object_attach(vgdev, obj, NULL);
if (ret)
goto err_obj_attach;
 
diff --git a/drivers/gpu/drm/virtio/virtgpu_gem.c 
b/drivers/gpu/drm/virtio/virtgpu_gem.c
index 8d53451ec4..665d18a49d 100644
--- a/drivers/gpu/drm/virtio/virtgpu_gem.c
+++ b/drivers/gpu/drm/virtio/virtgpu_gem.c
@@ -104,11 +104,11 @@ int virtio_gpu_mode_dumb_create(struct drm_file 
*file_priv,
format = virtio_gpu_translate_format(DRM_FORMAT_HOST_XRGB);
obj = gem_to_virtio_gpu_obj(gobj);
virtio_gpu_resource_id_get(vgdev, >hw_res_handle);
-   virtio_gpu_cmd_create_resource(vgdev, obj, obj->hw_res_handle, format,
+   virtio_gpu_cmd_create_resource(vgdev, obj, format,
   args->width, args->height);
 
/* attach the object to the resource */
-   ret = virtio_gpu_object_attach(vgdev, obj, obj->hw_res_handle, NULL);
+   ret = virtio_gpu_object_attach(vgdev, obj, NULL);
if (ret)
goto fail;
 
diff --git a/drivers/gpu/drm/virtio/virtgpu_ioctl.c 
b/drivers/gpu/drm/virtio/virtgpu_ioctl.c
index ebb0920411..6179d93167 100644
--- a/drivers/gpu/drm/virtio/virtgpu_ioctl.c
+++ b/drivers/gpu/drm/virtio/virtgpu_ioctl.c
@@ -256,10 +256,10 @@ static int virtio_gpu_resource_create_ioctl(struct 
drm_device *dev, void *data,
virtio_gpu_resource_id_get(vgdev, >hw_res_handle);
 
if (!vgdev->has_virgl_3d) {
-   virtio_gpu_cmd_create_resource(vgdev, qobj, 
qobj->hw_res_handle, rc->format,
+   virtio_gpu_cmd_create_resource(vgdev, qobj, rc->format,
   rc->width, rc->height);
 
-   ret = virtio_gpu_object_attach(vgdev, qobj, 
qobj->hw_res_handle, NULL);
+   ret = virtio_gpu_object_attach(vgdev, qobj, NULL);
} else {
/* use a gem reference since unref list undoes them */
drm_gem_object_get(>gem_base);
@@ -285,7 +285,7 @@ static int virtio_gpu_resource_create_ioctl(struct 
drm_device *dev, void *data,
rc_3d.flags = cpu_to_le32(rc->flags);
 
virtio_gpu_cmd_resource_create_3d(vgdev, qobj, _3d, NULL);
-   ret = virtio_gpu_object_attach(vgdev, qobj, 
qobj->hw_res_handle, );
+   ret = virtio_gpu_object_attach(vgdev, qobj, );
if (ret) {
 

[PATCH v2 3/6] drm/virtio: use virtio_gpu_object->hw_res_handle in virtio_gpu_mode_dumb_create()

2018-10-19 Thread Gerd Hoffmann
Drop pointless resid variable in virtio_gpu_mode_dumb_create(), just use
the hw_res_handle field in virtio_gpu_object directly.

Signed-off-by: Gerd Hoffmann 
---
 drivers/gpu/drm/virtio/virtgpu_gem.c | 8 +++-
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/virtio/virtgpu_gem.c 
b/drivers/gpu/drm/virtio/virtgpu_gem.c
index 33dbd5aed7..8d53451ec4 100644
--- a/drivers/gpu/drm/virtio/virtgpu_gem.c
+++ b/drivers/gpu/drm/virtio/virtgpu_gem.c
@@ -87,7 +87,6 @@ int virtio_gpu_mode_dumb_create(struct drm_file *file_priv,
struct virtio_gpu_object *obj;
int ret;
uint32_t pitch;
-   uint32_t resid;
uint32_t format;
 
if (args->bpp != 32)
@@ -104,13 +103,12 @@ int virtio_gpu_mode_dumb_create(struct drm_file 
*file_priv,
 
format = virtio_gpu_translate_format(DRM_FORMAT_HOST_XRGB);
obj = gem_to_virtio_gpu_obj(gobj);
-   virtio_gpu_resource_id_get(vgdev, );
-   virtio_gpu_cmd_create_resource(vgdev, obj, resid, format,
+   virtio_gpu_resource_id_get(vgdev, >hw_res_handle);
+   virtio_gpu_cmd_create_resource(vgdev, obj, obj->hw_res_handle, format,
   args->width, args->height);
 
/* attach the object to the resource */
-   obj = gem_to_virtio_gpu_obj(gobj);
-   ret = virtio_gpu_object_attach(vgdev, obj, resid, NULL);
+   ret = virtio_gpu_object_attach(vgdev, obj, obj->hw_res_handle, NULL);
if (ret)
goto fail;
 
-- 
2.9.3

___
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization


[PATCH v2 6/6] drm/virtio: fix resource id handling

2018-10-19 Thread Gerd Hoffmann
Move virtio_gpu_resource_id_{get,put} to virtgpu_object.c and make them
static.  Allocate and free the id on creation and destroy, drop all
other calls.  That way objects have a valid handle for the whole
lifetime of the object.

Also fixes ids leaking.  Worst offender are dumb buffers, and I think
some error paths too.

Signed-off-by: Gerd Hoffmann 
---
 drivers/gpu/drm/virtio/virtgpu_drv.h|  3 ---
 drivers/gpu/drm/virtio/virtgpu_fb.c |  1 -
 drivers/gpu/drm/virtio/virtgpu_gem.c|  1 -
 drivers/gpu/drm/virtio/virtgpu_ioctl.c  |  1 -
 drivers/gpu/drm/virtio/virtgpu_object.c | 23 +++
 drivers/gpu/drm/virtio/virtgpu_vq.c | 20 
 6 files changed, 23 insertions(+), 26 deletions(-)

diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.h 
b/drivers/gpu/drm/virtio/virtgpu_drv.h
index c6b0a938ba..78ad8f58ed 100644
--- a/drivers/gpu/drm/virtio/virtgpu_drv.h
+++ b/drivers/gpu/drm/virtio/virtgpu_drv.h
@@ -260,9 +260,6 @@ int virtio_gpu_surface_dirty(struct virtio_gpu_framebuffer 
*qfb,
 /* virtio vg */
 int virtio_gpu_alloc_vbufs(struct virtio_gpu_device *vgdev);
 void virtio_gpu_free_vbufs(struct virtio_gpu_device *vgdev);
-void virtio_gpu_resource_id_get(struct virtio_gpu_device *vgdev,
-  uint32_t *resid);
-void virtio_gpu_resource_id_put(struct virtio_gpu_device *vgdev, uint32_t id);
 void virtio_gpu_cmd_create_resource(struct virtio_gpu_device *vgdev,
struct virtio_gpu_object *bo,
uint32_t format,
diff --git a/drivers/gpu/drm/virtio/virtgpu_fb.c 
b/drivers/gpu/drm/virtio/virtgpu_fb.c
index c22a8246b6..fb1cc8b2f1 100644
--- a/drivers/gpu/drm/virtio/virtgpu_fb.c
+++ b/drivers/gpu/drm/virtio/virtgpu_fb.c
@@ -231,7 +231,6 @@ static int virtio_gpufb_create(struct drm_fb_helper *helper,
if (IS_ERR(obj))
return PTR_ERR(obj);
 
-   virtio_gpu_resource_id_get(vgdev, >hw_res_handle);
virtio_gpu_cmd_create_resource(vgdev, obj, format,
   mode_cmd.width, mode_cmd.height);
 
diff --git a/drivers/gpu/drm/virtio/virtgpu_gem.c 
b/drivers/gpu/drm/virtio/virtgpu_gem.c
index 665d18a49d..f065863939 100644
--- a/drivers/gpu/drm/virtio/virtgpu_gem.c
+++ b/drivers/gpu/drm/virtio/virtgpu_gem.c
@@ -103,7 +103,6 @@ int virtio_gpu_mode_dumb_create(struct drm_file *file_priv,
 
format = virtio_gpu_translate_format(DRM_FORMAT_HOST_XRGB);
obj = gem_to_virtio_gpu_obj(gobj);
-   virtio_gpu_resource_id_get(vgdev, >hw_res_handle);
virtio_gpu_cmd_create_resource(vgdev, obj, format,
   args->width, args->height);
 
diff --git a/drivers/gpu/drm/virtio/virtgpu_ioctl.c 
b/drivers/gpu/drm/virtio/virtgpu_ioctl.c
index 6179d93167..bc5afa4f90 100644
--- a/drivers/gpu/drm/virtio/virtgpu_ioctl.c
+++ b/drivers/gpu/drm/virtio/virtgpu_ioctl.c
@@ -253,7 +253,6 @@ static int virtio_gpu_resource_create_ioctl(struct 
drm_device *dev, void *data,
if (IS_ERR(qobj))
return PTR_ERR(qobj);
obj = >gem_base;
-   virtio_gpu_resource_id_get(vgdev, >hw_res_handle);
 
if (!vgdev->has_virgl_3d) {
virtio_gpu_cmd_create_resource(vgdev, qobj, rc->format,
diff --git a/drivers/gpu/drm/virtio/virtgpu_object.c 
b/drivers/gpu/drm/virtio/virtgpu_object.c
index 6611c487d7..8bd1ebe13b 100644
--- a/drivers/gpu/drm/virtio/virtgpu_object.c
+++ b/drivers/gpu/drm/virtio/virtgpu_object.c
@@ -25,6 +25,26 @@
 
 #include "virtgpu_drv.h"
 
+static void virtio_gpu_resource_id_get(struct virtio_gpu_device *vgdev,
+  uint32_t *resid)
+{
+   int handle;
+
+   idr_preload(GFP_KERNEL);
+   spin_lock(>resource_idr_lock);
+   handle = idr_alloc(>resource_idr, NULL, 1, 0, GFP_NOWAIT);
+   spin_unlock(>resource_idr_lock);
+   idr_preload_end();
+   *resid = handle;
+}
+
+static void virtio_gpu_resource_id_put(struct virtio_gpu_device *vgdev, 
uint32_t id)
+{
+   spin_lock(>resource_idr_lock);
+   idr_remove(>resource_idr, id);
+   spin_unlock(>resource_idr_lock);
+}
+
 static void virtio_gpu_ttm_bo_destroy(struct ttm_buffer_object *tbo)
 {
struct virtio_gpu_object *bo;
@@ -40,6 +60,7 @@ static void virtio_gpu_ttm_bo_destroy(struct 
ttm_buffer_object *tbo)
if (bo->vmap)
virtio_gpu_object_kunmap(bo);
drm_gem_object_release(>gem_base);
+   virtio_gpu_resource_id_put(vgdev, bo->hw_res_handle);
kfree(bo);
 }
 
@@ -81,9 +102,11 @@ int virtio_gpu_object_create(struct virtio_gpu_device 
*vgdev,
bo = kzalloc(sizeof(struct virtio_gpu_object), GFP_KERNEL);
if (bo == NULL)
return -ENOMEM;
+   virtio_gpu_resource_id_get(vgdev, >hw_res_handle);
size = roundup(size, PAGE_SIZE);
ret = drm_gem_object_init(vgdev->ddev, >gem_base, size);
if (ret != 0) {
+   

[PATCH v2 4/6] drm/virtio: use virtio_gpu_object->hw_res_handle in virtio_gpu_resource_create_ioctl()

2018-10-19 Thread Gerd Hoffmann
Drop pointless res_id variable in virtio_gpu_resource_create_ioctl(),
just use the hw_res_handle field in virtio_gpu_object directly.

Signed-off-by: Gerd Hoffmann 
---
 drivers/gpu/drm/virtio/virtgpu_ioctl.c | 24 
 1 file changed, 8 insertions(+), 16 deletions(-)

diff --git a/drivers/gpu/drm/virtio/virtgpu_ioctl.c 
b/drivers/gpu/drm/virtio/virtgpu_ioctl.c
index 98bb238e91..ebb0920411 100644
--- a/drivers/gpu/drm/virtio/virtgpu_ioctl.c
+++ b/drivers/gpu/drm/virtio/virtgpu_ioctl.c
@@ -217,7 +217,6 @@ static int virtio_gpu_resource_create_ioctl(struct 
drm_device *dev, void *data,
struct virtio_gpu_device *vgdev = dev->dev_private;
struct drm_virtgpu_resource_create *rc = data;
int ret;
-   uint32_t res_id;
struct virtio_gpu_object *qobj;
struct drm_gem_object *obj;
uint32_t handle = 0;
@@ -244,8 +243,6 @@ static int virtio_gpu_resource_create_ioctl(struct 
drm_device *dev, void *data,
INIT_LIST_HEAD(_list);
memset(, 0, sizeof(struct ttm_validate_buffer));
 
-   virtio_gpu_resource_id_get(vgdev, _id);
-
size = rc->size;
 
/* allocate a single page size object */
@@ -253,17 +250,16 @@ static int virtio_gpu_resource_create_ioctl(struct 
drm_device *dev, void *data,
size = PAGE_SIZE;
 
qobj = virtio_gpu_alloc_object(dev, size, false, false);
-   if (IS_ERR(qobj)) {
-   ret = PTR_ERR(qobj);
-   goto fail_id;
-   }
+   if (IS_ERR(qobj))
+   return PTR_ERR(qobj);
obj = >gem_base;
+   virtio_gpu_resource_id_get(vgdev, >hw_res_handle);
 
if (!vgdev->has_virgl_3d) {
-   virtio_gpu_cmd_create_resource(vgdev, qobj, res_id, rc->format,
+   virtio_gpu_cmd_create_resource(vgdev, qobj, 
qobj->hw_res_handle, rc->format,
   rc->width, rc->height);
 
-   ret = virtio_gpu_object_attach(vgdev, qobj, res_id, NULL);
+   ret = virtio_gpu_object_attach(vgdev, qobj, 
qobj->hw_res_handle, NULL);
} else {
/* use a gem reference since unref list undoes them */
drm_gem_object_get(>gem_base);
@@ -276,7 +272,7 @@ static int virtio_gpu_resource_create_ioctl(struct 
drm_device *dev, void *data,
goto fail_unref;
}
 
-   rc_3d.resource_id = cpu_to_le32(res_id);
+   rc_3d.resource_id = cpu_to_le32(qobj->hw_res_handle);
rc_3d.target = cpu_to_le32(rc->target);
rc_3d.format = cpu_to_le32(rc->format);
rc_3d.bind = cpu_to_le32(rc->bind);
@@ -289,7 +285,7 @@ static int virtio_gpu_resource_create_ioctl(struct 
drm_device *dev, void *data,
rc_3d.flags = cpu_to_le32(rc->flags);
 
virtio_gpu_cmd_resource_create_3d(vgdev, qobj, _3d, NULL);
-   ret = virtio_gpu_object_attach(vgdev, qobj, res_id, );
+   ret = virtio_gpu_object_attach(vgdev, qobj, 
qobj->hw_res_handle, );
if (ret) {
ttm_eu_backoff_reservation(, _list);
goto fail_unref;
@@ -297,8 +293,6 @@ static int virtio_gpu_resource_create_ioctl(struct 
drm_device *dev, void *data,
ttm_eu_fence_buffer_objects(, _list, >f);
}
 
-   qobj->hw_res_handle = res_id;
-
ret = drm_gem_handle_create(file_priv, obj, );
if (ret) {
 
@@ -311,7 +305,7 @@ static int virtio_gpu_resource_create_ioctl(struct 
drm_device *dev, void *data,
}
drm_gem_object_put_unlocked(obj);
 
-   rc->res_handle = res_id; /* similiar to a VM address */
+   rc->res_handle = qobj->hw_res_handle; /* similiar to a VM address */
rc->bo_handle = handle;
 
if (vgdev->has_virgl_3d) {
@@ -326,8 +320,6 @@ static int virtio_gpu_resource_create_ioctl(struct 
drm_device *dev, void *data,
}
 //fail_obj:
 // drm_gem_object_handle_unreference_unlocked(obj);
-fail_id:
-   virtio_gpu_resource_id_put(vgdev, res_id);
return ret;
 }
 
-- 
2.9.3

___
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization


[PATCH v2 2/6] drm/virtio: use virtio_gpu_object->hw_res_handle in virtio_gpufb_create()

2018-10-19 Thread Gerd Hoffmann
Drop pointless resid variable in virtio_gpufb_create(), just use
the hw_res_handle field in virtio_gpu_object directly.

Signed-off-by: Gerd Hoffmann 
---
 drivers/gpu/drm/virtio/virtgpu_fb.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/virtio/virtgpu_fb.c 
b/drivers/gpu/drm/virtio/virtgpu_fb.c
index d39f4f3350..800960bdd9 100644
--- a/drivers/gpu/drm/virtio/virtgpu_fb.c
+++ b/drivers/gpu/drm/virtio/virtgpu_fb.c
@@ -214,7 +214,7 @@ static int virtio_gpufb_create(struct drm_fb_helper *helper,
struct drm_framebuffer *fb;
struct drm_mode_fb_cmd2 mode_cmd = {};
struct virtio_gpu_object *obj;
-   uint32_t resid, format, size;
+   uint32_t format, size;
int ret;
 
mode_cmd.width = sizes->surface_width;
@@ -231,8 +231,8 @@ static int virtio_gpufb_create(struct drm_fb_helper *helper,
if (IS_ERR(obj))
return PTR_ERR(obj);
 
-   virtio_gpu_resource_id_get(vgdev, );
-   virtio_gpu_cmd_create_resource(vgdev, obj, resid, format,
+   virtio_gpu_resource_id_get(vgdev, >hw_res_handle);
+   virtio_gpu_cmd_create_resource(vgdev, obj, obj->hw_res_handle, format,
   mode_cmd.width, mode_cmd.height);
 
ret = virtio_gpu_object_kmap(obj);
@@ -242,7 +242,7 @@ static int virtio_gpufb_create(struct drm_fb_helper *helper,
}
 
/* attach the object to the resource */
-   ret = virtio_gpu_object_attach(vgdev, obj, resid, NULL);
+   ret = virtio_gpu_object_attach(vgdev, obj, obj->hw_res_handle, NULL);
if (ret)
goto err_obj_attach;
 
-- 
2.9.3

___
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization