]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm/amdgpu: Refine uvd_v6/7_0_enc_get_destroy_msg
authorRex Zhu <Rex.Zhu@amd.com>
Fri, 28 Sep 2018 07:25:06 +0000 (15:25 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 9 Oct 2018 22:04:38 +0000 (17:04 -0500)
1. make uvd_v7_0_enc_get_destroy_msg static
2. drop a function variable that always true

Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c
drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c

index 8ef4a5392112463f151fe9acefba40a3682e4fa0..7a5b40275e8e7b0ffa7600c99af464dfe5031a23 100644 (file)
@@ -274,7 +274,7 @@ err:
  */
 static int uvd_v6_0_enc_get_destroy_msg(struct amdgpu_ring *ring,
                                        uint32_t handle,
-                                       bool direct, struct dma_fence **fence)
+                                       struct dma_fence **fence)
 {
        const unsigned ib_size_dw = 16;
        struct amdgpu_job *job;
@@ -310,11 +310,7 @@ static int uvd_v6_0_enc_get_destroy_msg(struct amdgpu_ring *ring,
        for (i = ib->length_dw; i < ib_size_dw; ++i)
                ib->ptr[i] = 0x0;
 
-       if (direct)
-               r = amdgpu_job_submit_direct(job, ring, &f);
-       else
-               r = amdgpu_job_submit(job, &ring->adev->vce.entity,
-                                     AMDGPU_FENCE_OWNER_UNDEFINED, &f);
+       r = amdgpu_job_submit_direct(job, ring, &f);
        if (r)
                goto err;
 
@@ -345,7 +341,7 @@ static int uvd_v6_0_enc_ring_test_ib(struct amdgpu_ring *ring, long timeout)
                goto error;
        }
 
-       r = uvd_v6_0_enc_get_destroy_msg(ring, 1, true, &fence);
+       r = uvd_v6_0_enc_get_destroy_msg(ring, 1, &fence);
        if (r) {
                DRM_ERROR("amdgpu: failed to get destroy ib (%ld).\n", r);
                goto error;
index a289f6a20b6bd47560fe7230544a8ce3e13bbfcb..58b39afcfb86461d68e47496578184d2c7b74317 100644 (file)
@@ -280,8 +280,8 @@ err:
  *
  * Close up a stream for HW test or if userspace failed to do so
  */
-int uvd_v7_0_enc_get_destroy_msg(struct amdgpu_ring *ring, uint32_t handle,
-                                bool direct, struct dma_fence **fence)
+static int uvd_v7_0_enc_get_destroy_msg(struct amdgpu_ring *ring, uint32_t handle,
+                               struct dma_fence **fence)
 {
        const unsigned ib_size_dw = 16;
        struct amdgpu_job *job;
@@ -317,11 +317,7 @@ int uvd_v7_0_enc_get_destroy_msg(struct amdgpu_ring *ring, uint32_t handle,
        for (i = ib->length_dw; i < ib_size_dw; ++i)
                ib->ptr[i] = 0x0;
 
-       if (direct)
-               r = amdgpu_job_submit_direct(job, ring, &f);
-       else
-               r = amdgpu_job_submit(job, &ring->adev->vce.entity,
-                                     AMDGPU_FENCE_OWNER_UNDEFINED, &f);
+       r = amdgpu_job_submit_direct(job, ring, &f);
        if (r)
                goto err;
 
@@ -352,7 +348,7 @@ static int uvd_v7_0_enc_ring_test_ib(struct amdgpu_ring *ring, long timeout)
                goto error;
        }
 
-       r = uvd_v7_0_enc_get_destroy_msg(ring, 1, true, &fence);
+       r = uvd_v7_0_enc_get_destroy_msg(ring, 1, &fence);
        if (r) {
                DRM_ERROR("amdgpu: (%d)failed to get destroy ib (%ld).\n", ring->me, r);
                goto error;