Skip to contentSkip to conversation

drm/amd/display: assign fb_location only if bo is pinned

PATCH In review S, Shirish 7 participants 13 messages Oct 24, 2017 – Oct 26, 2017 11 messages not in the archive

Subsystems (3)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): 1508852848-17713-1-git-send-email-shirish.s12-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

S, Shirish

author
#2 lore raw

PATCH 1/1 drm/amd/display: assign fb_location only if bo is pinned

From: Shirish S <[email protected]>

On some systems amdgpu_bo_gpu_offset seems to be called before the BO is pinned, leading to page faults as the GPU address is still subject to change.

This patch fixes the above issue.

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +5 -2
index 974ee97..b251b7e 100644
@@ -1786,8 +1786,11 @@ static int get_fb_info(const struct amdgpu_framebuffer *amdgpu_fb,
 		return r;
 	}
 
-	if (fb_location)
-		*fb_location = amdgpu_bo_gpu_offset(rbo);
+	r = amdgpu_bo_pin(rbo, AMDGPU_GEM_DOMAIN_VRAM, fb_location);
+	if (unlikely(r != 0)) {
+		amdgpu_bo_unreserve(rbo);
+		return -EINVAL;
+	}
 
 	if (tiling_flags)
 		amdgpu_bo_get_tiling_flags(rbo, tiling_flags);
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): BN6PR12MB18268EA378DD476F38B2FED7F2470-/b2+HYfkarSCndJ3FSsNdQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org

#4 lore raw
Quoted 18 lines · Shirish

From: Shirish S <[email protected]>

On some systems amdgpu_bo_gpu_offset seems to be called before the BO is pinned, leading to page faults as the GPU address is still subject to change.

This patch fixes the above issue.

---
  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 7 +++++--
  1 file changed, 5 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -0
index 974ee97..b251b7e 100644

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static int get_fb_info(const struct amdgpu_framebuffer *amdgpu_fb, · line 1793

Quoted 10 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +5 -2
@@ -1786,8 +1786,11 @@ static int get_fb_info(const struct amdgpu_framebuffer *amdgpu_fb,
  		return r;
  	}
 
-	if (fb_location)
-		*fb_location = amdgpu_bo_gpu_offset(rbo);
+	r = amdgpu_bo_pin(rbo, AMDGPU_GEM_DOMAIN_VRAM, fb_location);
+	if (unlikely(r != 0)) {
+		amdgpu_bo_unreserve(rbo);
+		return -EINVAL;
+	}

Where the unpin would happen then ? Today DAL calls pin from dm_plane_helper_prepare_fb while the unpin from dm_plane_helper_cleanup_fb.

Thanks,
Andrey

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static int get_fb_info(const struct amdgpu_framebuffer *amdgpu_fb, · line 1796

Quoted 3 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -0
  	if (tiling_flags)
  		amdgpu_bo_get_tiling_flags(rbo, tiling_flags);

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 44152644-4a1f-23b5-3b3a-81fc9bb90007-5C7GfCeVMHo@public.gmane.org

#6 lore raw
Quoted 25 lines · Andrey Grodzovsky
Quoted 22 lines · Shirish

From: Shirish S <[email protected]>

On some systems amdgpu_bo_gpu_offset seems to be called before the BO is pinned, leading to page faults as the GPU address is still subject to change.

This patch fixes the above issue.

---
  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 7 +++++--

  1 file changed, 5 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -0
index 974ee97..b251b7e 100644
@@ -1786,8 +1786,11 @@ static int get_fb_info(const struct 
 amdgpu_framebuffer *amdgpu_fb,
           return r;
       }
   -    if (fb_location)
Quoted 9 lines

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static int get_fb_info(const struct amdgpu_framebuffer *amdgpu_fb, · line 1793

Quoted 6 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +5 -1
-        *fb_location = amdgpu_bo_gpu_offset(rbo);
+    r = amdgpu_bo_pin(rbo, AMDGPU_GEM_DOMAIN_VRAM, fb_location);
+    if (unlikely(r != 0)) {
+        amdgpu_bo_unreserve(rbo);
+        return -EINVAL;
+    }

Where the unpin would happen then ? Today DAL calls pin from dm_plane_helper_prepare_fb while the unpin from dm_plane_helper_cleanup_fb.

Good point, am trying to address the issue Michel is facing, if this patch works, we can think of unpinning the bo appropriately. Ideally it should be at the end of amdgpu_dm_atomic_check(). Can you think of any better place?
Regards,
Shirish S

Quoted 6 lines

Thanks,
Andrey

Quoted 2 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -0
         if (tiling_flags)
           amdgpu_bo_get_tiling_flags(rbo, tiling_flags);

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 59f795cf-f25c-2b7b-9775-0f685131d7d8-5C7GfCeVMHo@public.gmane.org

#8 lore raw
Quoted 37 lines · Shirish
Quoted 25 lines · Andrey Grodzovsky
Quoted 22 lines · Shirish

From: Shirish S <[email protected]>

On some systems amdgpu_bo_gpu_offset seems to be called before the BO is pinned, leading to page faults as the GPU address is still subject to change.

This patch fixes the above issue.

---
  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 7 +++++--
  1 file changed, 5 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -0
index 974ee97..b251b7e 100644
@@ -1786,8 +1786,11 @@ static int get_fb_info(const struct 
 amdgpu_framebuffer *amdgpu_fb,
          return r;
      }
  -    if (fb_location)
Quoted 9 lines

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static int get_fb_info(const struct amdgpu_framebuffer *amdgpu_fb, · line 1793

Quoted 6 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +5 -1
-        *fb_location = amdgpu_bo_gpu_offset(rbo);
+    r = amdgpu_bo_pin(rbo, AMDGPU_GEM_DOMAIN_VRAM, fb_location);
+    if (unlikely(r != 0)) {
+        amdgpu_bo_unreserve(rbo);
+        return -EINVAL;
+    }

Where the unpin would happen then ? Today DAL calls pin from dm_plane_helper_prepare_fb while the unpin from dm_plane_helper_cleanup_fb.

Quoted 2 lines

Good point, am trying to address the issue Michel is facing, if this patch works, we can think of unpinning the bo appropriately. Ideally it should be at the end of amdgpu_dm_atomic_check(). Can you think of any better place?

Sounds right, you have to unpin within atomic_check since UMD might call check without commit sometimes.

Andrey

Quoted 9 lines

Regards,
Shirish S

Quoted 6 lines

Thanks,
Andrey

Quoted 2 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -0
        if (tiling_flags)
          amdgpu_bo_get_tiling_flags(rbo, tiling_flags);

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 41ca6c61-1ade-8bf3-cc45-c1adf8606976-5C7GfCeVMHo@public.gmane.org

#10 lore raw

[ Adding the dri-devel list ]

Quoted 37 lines · Andrey Grodzovsky
Quoted 36 lines · Shirish
Quoted 35 lines · Andrey Grodzovsky
Quoted 19 lines · Shirish

From: Shirish S <[email protected]>

On some systems amdgpu_bo_gpu_offset seems to be called before the BO is pinned, leading to page faults as the GPU address is still subject to change.

This patch fixes the above issue.

---
  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 7 +++++--

  1 file changed, 5 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -0
index 974ee97..b251b7e 100644

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static int get_fb_info(const struct · line 1794

Quoted 10 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +5 -1
@@ -1786,8 +1786,11 @@ static int get_fb_info(const struct
 amdgpu_framebuffer *amdgpu_fb,
           return r;
       }
   -    if (fb_location)
-        *fb_location = amdgpu_bo_gpu_offset(rbo);
+    r = amdgpu_bo_pin(rbo, AMDGPU_GEM_DOMAIN_VRAM, fb_location);
+    if (unlikely(r != 0)) {
+        amdgpu_bo_unreserve(rbo);
+        return -EINVAL;
+    }

Where the unpin would happen then ? Today DAL calls pin from dm_plane_helper_prepare_fb while the unpin from dm_plane_helper_cleanup_fb.

Quoted 7 lines
Quoted 4 lines

Good point, am trying to address the issue Michel is facing, if this patch works, we can think of unpinning the bo appropriately. Ideally it should be at the end of amdgpu_dm_atomic_check(). Can you think of any better place?

Sounds right, you have to unpin within atomic_check since UMD might call check without commit sometimes.

Not sure it's appropriate to pin BOs from atomic_check.

In general, BOs should be pinned just before the display hardware starts accessing them, and unpinned just after it stops accessing them.

Signature · 6 lines
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 21693e67-aa36-a4a9-12ac-18e6c5a32e63-otUistvHUpPR7s880joybQ@public.gmane.org

#12 lore raw
Quoted 43 lines · Michel Dänzer

[ Adding the dri-devel list ]

Quoted 40 lines · Andrey Grodzovsky
Quoted 39 lines · Shirish
Quoted 25 lines · Andrey Grodzovsky
Quoted 24 lines · Shirish

From: Shirish S <[email protected]>

On some systems amdgpu_bo_gpu_offset seems to be called before the BO is pinned, leading to page faults as the GPU address is still subject to change.

This patch fixes the above issue.

---
   drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 7 +++++--
   1 file changed, 5 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -1
index 974ee97..b251b7e 100644
@@ -1786,8 +1786,11 @@ static int get_fb_info(const struct
 amdgpu_framebuffer *amdgpu_fb,
           return r;
       }
   -    if (fb_location)
-        *fb_location = amdgpu_bo_gpu_offset(rbo);
Quoted 9 lines

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static int get_fb_info(const struct · line 1794

Quoted 5 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +5 -0
+    r = amdgpu_bo_pin(rbo, AMDGPU_GEM_DOMAIN_VRAM, fb_location);
+    if (unlikely(r != 0)) {
+        amdgpu_bo_unreserve(rbo);
+        return -EINVAL;
+    }

Where the unpin would happen then ? Today DAL calls pin from dm_plane_helper_prepare_fb while the unpin from dm_plane_helper_cleanup_fb.

Good point, am trying to address the issue Michel is facing, if this patch works, we can think of unpinning the bo appropriately. Ideally it should be at the end of amdgpu_dm_atomic_check(). Can you think of any better place?

Quoted 6 lines
Quoted 2 lines

Sounds right, you have to unpin within atomic_check since UMD might call check without commit sometimes.

Not sure it's appropriate to pin BOs from atomic_check.

In general, BOs should be pinned just before the display hardware starts accessing them, and unpinned just after it stops accessing them.

Not sure what other option (unless moving fill_plane_attributes_from_fb to commit) since new fb parameters are needed in check to build the new plane state. Before we did upstream refactoring get_fb_info was always called called from atomic_commit so it was within pin/unpin scope. Moving it out into check we missed the problem Shirish just found. We can't do pin in beginning of check and unpin in the end of commit because as i said, sometimes check is called w\o commit, and as much as I remember we can't do it in caller of check/commit sequence without changing DRM code.

Thanks,
Andrey

Quoted 2 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 1c36babd-69ee-e701-d857-c6eb8ebab2c3-5C7GfCeVMHo@public.gmane.org

#14 lore raw
Quoted 44 lines · Andrey Grodzovsky
Quoted 43 lines · Michel Dänzer
Quoted 42 lines · Andrey Grodzovsky
Quoted 35 lines · Shirish
Quoted 25 lines · Andrey Grodzovsky
Quoted 24 lines · Shirish

From: Shirish S <[email protected]>

On some systems amdgpu_bo_gpu_offset seems to be called before the BO is pinned, leading to page faults as the GPU address is still subject to change.

This patch fixes the above issue.

---
   drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 7 +++++--

   1 file changed, 5 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -1
index 974ee97..b251b7e 100644
@@ -1786,8 +1786,11 @@ static int get_fb_info(const struct
 amdgpu_framebuffer *amdgpu_fb,
            return r;
        }
    -    if (fb_location)
-        *fb_location = amdgpu_bo_gpu_offset(rbo);
Quoted 9 lines

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static int get_fb_info(const struct · line 1794

Quoted 5 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +5 -0
+    r = amdgpu_bo_pin(rbo, AMDGPU_GEM_DOMAIN_VRAM, fb_location);
+    if (unlikely(r != 0)) {
+        amdgpu_bo_unreserve(rbo);
+        return -EINVAL;
+    }

Where the unpin would happen then ? Today DAL calls pin from dm_plane_helper_prepare_fb while the unpin from dm_plane_helper_cleanup_fb.

Quoted 4 lines

Good point, am trying to address the issue Michel is facing, if this patch works, we can think of unpinning the bo appropriately. Ideally it should be at the end of amdgpu_dm_atomic_check(). Can you think of any better place?

Sounds right, you have to unpin within atomic_check since UMD might call check without commit sometimes.

Quoted 7 lines
Quoted 4 lines

Not sure it's appropriate to pin BOs from atomic_check.

In general, BOs should be pinned just before the display hardware starts accessing them, and unpinned just after it stops accessing them.

Not sure what other option (unless moving fill_plane_attributes_from_fb to commit)

If that is possible, it sounds like the proper solution.

Quoted 1 line

since new fb parameters are needed in check to build the new plane state.

Is the BO's MC address needed for the new plane state though?

Quoted 3 lines

Before we did upstream refactoring get_fb_info was always called called from atomic_commit so it was within pin/unpin scope. Moving it out into check we missed the problem Shirish just found.

Actually, I found it. :)

Quoted 2 lines

We can't do pin in beginning of check and unpin in the end of commit because as i said, sometimes check is called w\o commit, [...]

That also means pinning and unpinning within check isn't a good solution, since pinning might involve moving the buffer, which could be a waste of effort if the commit never follows.

Signature · 6 lines
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): efda8b1f-763c-939a-a1e6-5dd1ad5d3e81-otUistvHUpPR7s880joybQ@public.gmane.org

#16 lore raw
Quoted 47 lines · Michel Dänzer
Quoted 46 lines · Andrey Grodzovsky
Quoted 45 lines · Michel Dänzer
Quoted 36 lines · Andrey Grodzovsky
Quoted 35 lines · Shirish
Quoted 34 lines · Andrey Grodzovsky
Quoted 19 lines · Shirish

From: Shirish S <[email protected]>

On some systems amdgpu_bo_gpu_offset seems to be called before the BO is pinned, leading to page faults as the GPU address is still subject to change.

This patch fixes the above issue.

---
    drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 7 +++++--
    1 file changed, 5 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -0
index 974ee97..b251b7e 100644

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static int get_fb_info(const struct · line 1794

Quoted 10 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +5 -1
@@ -1786,8 +1786,11 @@ static int get_fb_info(const struct
 amdgpu_framebuffer *amdgpu_fb,
            return r;
        }
    -    if (fb_location)
-        *fb_location = amdgpu_bo_gpu_offset(rbo);
+    r = amdgpu_bo_pin(rbo, AMDGPU_GEM_DOMAIN_VRAM, fb_location);
+    if (unlikely(r != 0)) {
+        amdgpu_bo_unreserve(rbo);
+        return -EINVAL;
+    }

Where the unpin would happen then ? Today DAL calls pin from dm_plane_helper_prepare_fb while the unpin from dm_plane_helper_cleanup_fb.

Quoted 6 lines
Quoted 4 lines

Good point, am trying to address the issue Michel is facing, if this patch works, we can think of unpinning the bo appropriately. Ideally it should be at the end of amdgpu_dm_atomic_check(). Can you think of any better place?

Sounds right, you have to unpin within atomic_check since UMD might call check without commit sometimes.

Not sure it's appropriate to pin BOs from atomic_check.

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

In general, BOs should be pinned just before the display hardware starts accessing them, and unpinned just after it stops accessing them.

Not sure what other option (unless moving fill_plane_attributes_from_fb to commit)

If that is possible, it sounds like the proper solution.

Quoted 1 line

since new fb parameters are needed in check to build the new plane state.

Is the BO's MC address needed for the new plane state though?

Yea, in general it seems tiling flags and address stuff can be deferred to commit since they are really only needed for actual programming and by this skipping the need to call get_fb_info during check. The only problem is no sanity can be done on them in that case.

Thanks,
Andrey

Quoted 5 lines
Quoted 5 lines

Before we did upstream refactoring get_fb_info was always called called from atomic_commit so it was within pin/unpin scope. Moving it out into check we missed the problem Shirish just found.

Quoted 9 lines

Actually, I found it. :)

Quoted 2 lines

We can't do pin in beginning of check and unpin in the end of commit because as i said, sometimes check is called w\o commit, [...]

That also means pinning and unpinning within check isn't a good solution, since pinning might involve moving the buffer, which could be a waste of effort if the commit never follows.

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#17 lore raw
Quoted 56 lines · Andrey Grodzovsky
Quoted 53 lines · Michel Dänzer
Quoted 42 lines · Andrey Grodzovsky
Quoted 41 lines · Michel Dänzer
Quoted 40 lines · Andrey Grodzovsky
Quoted 39 lines · Shirish
Quoted 25 lines · Andrey Grodzovsky
Quoted 24 lines · Shirish

From: Shirish S <[email protected]>

On some systems amdgpu_bo_gpu_offset seems to be called before the BO is pinned, leading to page faults as the GPU address is still subject to change.

This patch fixes the above issue.

---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 7 +++++--

    1 file changed, 5 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -1
index 974ee97..b251b7e 100644
@@ -1786,8 +1786,11 @@ static int get_fb_info(const struct
 amdgpu_framebuffer *amdgpu_fb,
             return r;
         }
     -    if (fb_location)
-        *fb_location = amdgpu_bo_gpu_offset(rbo);
Quoted 9 lines

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static int get_fb_info(const struct · line 1794

Quoted 5 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +5 -0
+    r = amdgpu_bo_pin(rbo, AMDGPU_GEM_DOMAIN_VRAM, fb_location);
+    if (unlikely(r != 0)) {
+        amdgpu_bo_unreserve(rbo);
+        return -EINVAL;
+    }

Where the unpin would happen then ? Today DAL calls pin from dm_plane_helper_prepare_fb while the unpin from dm_plane_helper_cleanup_fb.

Good point, am trying to address the issue Michel is facing, if this patch works, we can think of unpinning the bo appropriately. Ideally it should be at the end of amdgpu_dm_atomic_check(). Can you think of any better place?

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

Sounds right, you have to unpin within atomic_check since UMD might call check without commit sometimes.

Not sure it's appropriate to pin BOs from atomic_check.

In general, BOs should be pinned just before the display hardware starts accessing them, and unpinned just after it stops accessing them.

Not sure what other option (unless moving fill_plane_attributes_from_fb to commit)

If that is possible, it sounds like the proper solution.

Quoted 8 lines
Quoted 2 lines
Quoted 1 line

since new fb parameters are needed in check to build the new plane state.

Is the BO's MC address needed for the new plane state though?

Yea, in general it seems tiling flags and address stuff can be deferred to commit since they are really only needed for actual programming and by this skipping the need to call get_fb_info during check. The only problem is no sanity can be done on them in that case.

Andrey,
Till now the get_fb_info() never calculated fb_location(as addrReq was always false), but since now its required to program the high part of the address structure, can you move it back into the commit scope and ensure that fb_location is calculated everytime.(I have limited knowledge behind why it was moved out) And in case if you insist on adding pin & unpin in atomic_check() scope i can post a patch for it.
Regards,
Shirish S

Quoted 18 lines

Thanks,
Andrey

Quoted 14 lines
Quoted 5 lines

Before we did upstream refactoring get_fb_info was always called called from atomic_commit so it was within pin/unpin scope. Moving it out into check we missed the problem Shirish just found.

Actually, I found it. :)

Quoted 2 lines

We can't do pin in beginning of check and unpin in the end of commit because as i said, sometimes check is called w\o commit, [...]

That also means pinning and unpinning within check isn't a good solution, since pinning might involve moving the buffer, which could be a waste of effort if the commit never follows.

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#18 lore raw
Quoted 10 lines · Shirish

Andrey,
Till now the get_fb_info() never calculated fb_location(as addrReq was always false), but since now its required to program the high part of the address structure,
can you move it back into the commit scope and ensure that fb_location is calculated everytime.(I have limited knowledge behind why it was moved out)
And in case if you insist on adding pin & unpin in atomic_check() scope i can post a patch for it.

The latter on its own couldn't really solve the problem anyway: While a BO is unpinned, its MC address can change at any time. The MC address programmed to the hardware must be determined while the BO is and stays pinned.

Signature · 6 lines
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

A message that is not in the archive (sent off-list or not yet received): c270f341-c59b-7f56-eb1a-94c765673b89-otUistvHUpPR7s880joybQ@public.gmane.org

author
#20 lore raw

Hi Alex, Michel & Andrey,

[PATCH] drm/amd/display: assign fb_location only if bo is pinned [PATCH 2/2] drm/amd/display: cleanup addReq and fix fb_location

should be dropped and instead:

[PATCH] drm/amd/display: fix high part address in dm_plane_helper_prepare_fb()

should be reviewed .

With this change I don’t have clean-up addReq, as I get the gpu_offset required for high part in dm_plane_helper_prepare_fb().

Thanks.
Regards,
Shirish S

-----Original Message-----
From: Michel Dänzer [mailto:[email protected]]
Sent: Wednesday, October 25, 2017 1:38 PM
To: S, Shirish <[email protected]>; Grodzovsky, Andrey <[email protected]>
Cc: Deucher, Alexander <[email protected]>; [email protected]; [email protected]
Subject: Re: [PATCH] drm/amd/display: assign fb_location only if bo is pinned

Quoted 10 lines · Shirish

Andrey,
Till now the get_fb_info() never calculated fb_location(as addrReq was always false), but since now its required to program the high part of the address structure,
can you move it back into the commit scope and ensure that fb_location is calculated everytime.(I have limited knowledge behind why it was moved out)
And in case if you insist on adding pin & unpin in atomic_check() scope i can post a patch for it.

The latter on its own couldn't really solve the problem anyway: While a BO is unpinned, its MC address can change at any time. The MC address programmed to the hardware must be determined while the BO is and stays pinned.

Signature · 6 lines
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): BN6PR12MB182689AA79CD6FA9AF0E2B51F2440-/b2+HYfkarSCndJ3FSsNdQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org

Reviewed-by
#22 lore raw
Quoted 6 lines · Shirish

Hi Alex, Michel & Andrey,

[PATCH] drm/amd/display: assign fb_location only if bo is pinned [PATCH 2/2] drm/amd/display: cleanup addReq and fix fb_location

should be dropped and instead:

Since you pushed the latter to amd-staging-drm-next, please revert it there, or maybe submit another patch removing all fb_location related code from get_fb_info and fill_plane_attributes_from_fb.

Quoted 3 lines

[PATCH] drm/amd/display: fix high part address in dm_plane_helper_prepare_fb()

should be reviewed .

But please wait for review from DC folks.

Signature · 6 lines
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Reviewed-by Michel Dänzer
#23 lore raw

I have reverted
[PATCH 2/2] drm/amd/display: cleanup addReq and fix fb_location and applied
[PATCH] drm/amd/display: fix high part address in dm_plane_helper_prepare_fb() onto amd-drm-staging kernel.

Regards,
Shirish S

-----Original Message-----
From: Michel Dänzer [mailto:[email protected]]
Sent: Wednesday, October 25, 2017 3:54 PM
To: S, Shirish <[email protected]>; Grodzovsky, Andrey <[email protected]>
Cc: Deucher, Alexander <[email protected]>; [email protected]; [email protected]
Subject: Re: [PATCH] drm/amd/display: assign fb_location only if bo is pinned

Quoted 6 lines · Shirish

Hi Alex, Michel & Andrey,

[PATCH] drm/amd/display: assign fb_location only if bo is pinned
[PATCH 2/2] drm/amd/display: cleanup addReq and fix fb_location

should be dropped and instead:

Since you pushed the latter to amd-staging-drm-next, please revert it there, or maybe submit another patch removing all fb_location related code from get_fb_info and fill_plane_attributes_from_fb.

Quoted 4 lines

[PATCH] drm/amd/display: fix high part address in
dm_plane_helper_prepare_fb()

should be reviewed .

But please wait for review from DC folks.

Signature · 6 lines
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel