VIGS: Don't 'update_vram' on 'set_root_surface'
authorStanislav Vorobiov <s.vorobiov@samsung.com>
Fri, 2 Aug 2013 13:54:12 +0000 (17:54 +0400)
committerStanislav Vorobiov <s.vorobiov@samsung.com>
Fri, 2 Aug 2013 13:54:12 +0000 (17:54 +0400)
This is now automatically happens on glFinish,
eglSwapBuffers, eglCopyBuffers, etc.

drivers/gpu/drm/vigs/vigs_comm.c
drivers/gpu/drm/vigs/vigs_comm.h
drivers/gpu/drm/vigs/vigs_crtc.c

index 5ef8ed10547024208df0788123c79365767925e0..668026f6c8e3b5168a4c0dfb5aa7b778d90bd9a3 100644 (file)
@@ -327,63 +327,25 @@ int vigs_comm_destroy_surface(struct vigs_comm *comm, vigsp_surface_id id)
 
 int vigs_comm_set_root_surface(struct vigs_comm *comm,
                                vigsp_surface_id id,
-                               vigsp_offset offset,
-                               bool update_vram)
+                               vigsp_offset offset)
 {
     int ret;
-    struct vigsp_cmd_batch_header *batch_header;
-    struct vigsp_cmd_request_header *update_vram_header = NULL;
-    struct vigsp_cmd_update_vram_request *update_vram_request = NULL;
-    struct vigsp_cmd_request_header *set_root_surface_header;
-    struct vigsp_cmd_set_root_surface_request *set_root_surface_request;
-    void *ptr;
+    struct vigsp_cmd_set_root_surface_request *request;
 
     DRM_DEBUG_DRIVER("id = %u, offset = %u\n", id, offset);
 
     mutex_lock(&comm->mutex);
 
-    ret = vigs_comm_alloc(comm,
-                          sizeof(*batch_header) +
-                          (update_vram ? sizeof(*update_vram_header) +
-                                         sizeof(*update_vram_request)
-                                       : 0) +
-                          sizeof(*set_root_surface_header) +
-                          sizeof(*set_root_surface_request) +
-                          sizeof(struct vigsp_cmd_response_header),
-                          &ptr);
+    ret = vigs_comm_prepare(comm,
+                            vigsp_cmd_set_root_surface,
+                            sizeof(*request),
+                            0,
+                            (void**)&request,
+                            NULL);
 
     if (ret == 0) {
-        batch_header = ptr;
-        ptr = batch_header + 1;
-
-        if (update_vram) {
-            update_vram_header = ptr;
-            ptr = update_vram_header + 1;
-            update_vram_request = ptr;
-            ptr = update_vram_request + 1;
-        }
-
-        set_root_surface_header = ptr;
-        ptr = set_root_surface_header + 1;
-        set_root_surface_request = ptr;
-
-        if (update_vram) {
-            batch_header->num_requests = 2;
-
-            update_vram_header->cmd = vigsp_cmd_update_vram;
-            update_vram_header->size = sizeof(*update_vram_request);
-
-            update_vram_request->sfc_id = id;
-            update_vram_request->offset = offset;
-        } else {
-            batch_header->num_requests = 1;
-        }
-
-        set_root_surface_header->cmd = vigsp_cmd_set_root_surface;
-        set_root_surface_header->size = sizeof(*set_root_surface_request);
-
-        set_root_surface_request->id = id;
-        set_root_surface_request->offset = offset;
+        request->id = id;
+        request->offset = offset;
 
         ret = vigs_comm_exec_internal(comm);
     }
index f88aac751e19b0111931dc79963ad981e5209206..5372696fb3e0f78fcb5b6d79885477216a1fa0e9 100644 (file)
@@ -51,8 +51,7 @@ int vigs_comm_destroy_surface(struct vigs_comm *comm, vigsp_surface_id id);
 
 int vigs_comm_set_root_surface(struct vigs_comm *comm,
                                vigsp_surface_id id,
-                               vigsp_offset offset,
-                               bool update_vram);
+                               vigsp_offset offset);
 
 int vigs_comm_update_vram(struct vigs_comm *comm,
                           vigsp_surface_id id,
index 43b856d0007ede5d39971192fc210bafbde8c1d2..9c414e9500b446146dbd46db1dbc1e886a46308f 100644 (file)
@@ -36,8 +36,7 @@ static int vigs_crtc_update(struct drm_crtc *crtc,
 
     ret = vigs_comm_set_root_surface(vigs_dev->comm,
                                      vigs_fb->fb_sfc->id,
-                                     vigs_gem_offset(&vigs_fb->fb_sfc->gem),
-                                     vigs_fb->fb_sfc->is_gpu_dirty);
+                                     vigs_gem_offset(&vigs_fb->fb_sfc->gem));
 
     vigs_gem_unreserve(&vigs_fb->fb_sfc->gem);
 
@@ -253,7 +252,7 @@ static void vigs_crtc_disable(struct drm_crtc *crtc)
         return;
     }
 
-    vigs_comm_set_root_surface(vigs_dev->comm, 0, 0, false);
+    vigs_comm_set_root_surface(vigs_dev->comm, 0, 0);
 
     vigs_framebuffer_unpin(fb_to_vigs_fb(crtc->fb));
 }