diff mbox series

drm/i915/dsb: Enable lmem for dsb

Message ID 20200131114258.22306-1-animesh.manna@intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915/dsb: Enable lmem for dsb | expand

Commit Message

Manna, Animesh Jan. 31, 2020, 11:42 a.m. UTC
If lmem is supported DSB should use local memeory instead
of system memory. Using local memory surely bring performance
improvement as local memory is close to gpu. Also want to avoid
multiple gpu using system memory.

Used LMEM api to create gem object needed for DSB command buffer.

v1: Initial patch.

Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Matthew Auld <matthew.auld@intel.com>
Cc: Ramalingam C <ramalingam.c@intel.com>
Signed-off-by: Animesh Manna <animesh.manna@intel.com>
---
 drivers/gpu/drm/i915/display/intel_dsb.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Comments

Ville Syrjälä Jan. 31, 2020, 12:03 p.m. UTC | #1
On Fri, Jan 31, 2020 at 05:12:58PM +0530, Animesh Manna wrote:
> If lmem is supported DSB should use local memeory instead
> of system memory. Using local memory surely bring performance
> improvement as local memory is close to gpu. Also want to avoid
> multiple gpu using system memory.
> 
> Used LMEM api to create gem object needed for DSB command buffer.

The whole point of the dsb is to avoid doing mmio.a Now you're
replacing the nice dma with mmio again. Granted lmem is probably
wc so maybe not as slow as direct mmio register access, and also
we can do this ahead of time so not as time critical as direct
mmio during the the vblank.

> 
> v1: Initial patch.
> 
> Cc: Jani Nikula <jani.nikula@linux.intel.com>
> Cc: Matthew Auld <matthew.auld@intel.com>
> Cc: Ramalingam C <ramalingam.c@intel.com>
> Signed-off-by: Animesh Manna <animesh.manna@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_dsb.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_dsb.c b/drivers/gpu/drm/i915/display/intel_dsb.c
> index 9dd18144a664..d67b6a764ba0 100644
> --- a/drivers/gpu/drm/i915/display/intel_dsb.c
> +++ b/drivers/gpu/drm/i915/display/intel_dsb.c
> @@ -6,6 +6,7 @@
>  
>  #include "i915_drv.h"
>  #include "intel_display_types.h"
> +#include "gem/i915_gem_lmem.h"
>  
>  #define DSB_BUF_SIZE    (2 * PAGE_SIZE)
>  
> @@ -113,7 +114,11 @@ intel_dsb_get(struct intel_crtc *crtc)
>  
>  	wakeref = intel_runtime_pm_get(&i915->runtime_pm);
>  
> -	obj = i915_gem_object_create_internal(i915, DSB_BUF_SIZE);
> +	if (HAS_LMEM(i915))
> +		obj = i915_gem_object_create_lmem(i915, DSB_BUF_SIZE, 0);
> +	else
> +		obj = i915_gem_object_create_internal(i915, DSB_BUF_SIZE);
> +
>  	if (IS_ERR(obj)) {
>  		DRM_ERROR("Gem object creation failed\n");
>  		goto out;
> -- 
> 2.24.0
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Manna, Animesh Jan. 31, 2020, 5:24 p.m. UTC | #2
On 31-01-2020 17:33, Ville Syrjälä wrote:
> On Fri, Jan 31, 2020 at 05:12:58PM +0530, Animesh Manna wrote:
>> If lmem is supported DSB should use local memeory instead
>> of system memory. Using local memory surely bring performance
>> improvement as local memory is close to gpu. Also want to avoid
>> multiple gpu using system memory.
>>
>> Used LMEM api to create gem object needed for DSB command buffer.
> The whole point of the dsb is to avoid doing mmio.a Now you're
> replacing the nice dma with mmio again. Granted lmem is probably
> wc so maybe not as slow as direct mmio register access, and also
> we can do this ahead of time so not as time critical as direct
> mmio during the the vblank.

As per sas documentation Lmem (HBM) memory is preferable for command/batch buffer, planning to do some profiling. Will update the result.

Regards,
Animesh

>
>> v1: Initial patch.
>>
>> Cc: Jani Nikula <jani.nikula@linux.intel.com>
>> Cc: Matthew Auld <matthew.auld@intel.com>
>> Cc: Ramalingam C <ramalingam.c@intel.com>
>> Signed-off-by: Animesh Manna <animesh.manna@intel.com>
>> ---
>>   drivers/gpu/drm/i915/display/intel_dsb.c | 7 ++++++-
>>   1 file changed, 6 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/i915/display/intel_dsb.c b/drivers/gpu/drm/i915/display/intel_dsb.c
>> index 9dd18144a664..d67b6a764ba0 100644
>> --- a/drivers/gpu/drm/i915/display/intel_dsb.c
>> +++ b/drivers/gpu/drm/i915/display/intel_dsb.c
>> @@ -6,6 +6,7 @@
>>   
>>   #include "i915_drv.h"
>>   #include "intel_display_types.h"
>> +#include "gem/i915_gem_lmem.h"
>>   
>>   #define DSB_BUF_SIZE    (2 * PAGE_SIZE)
>>   
>> @@ -113,7 +114,11 @@ intel_dsb_get(struct intel_crtc *crtc)
>>   
>>   	wakeref = intel_runtime_pm_get(&i915->runtime_pm);
>>   
>> -	obj = i915_gem_object_create_internal(i915, DSB_BUF_SIZE);
>> +	if (HAS_LMEM(i915))
>> +		obj = i915_gem_object_create_lmem(i915, DSB_BUF_SIZE, 0);
>> +	else
>> +		obj = i915_gem_object_create_internal(i915, DSB_BUF_SIZE);
>> +
>>   	if (IS_ERR(obj)) {
>>   		DRM_ERROR("Gem object creation failed\n");
>>   		goto out;
>> -- 
>> 2.24.0
>>
>> _______________________________________________
>> Intel-gfx mailing list
>> Intel-gfx@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_dsb.c b/drivers/gpu/drm/i915/display/intel_dsb.c
index 9dd18144a664..d67b6a764ba0 100644
--- a/drivers/gpu/drm/i915/display/intel_dsb.c
+++ b/drivers/gpu/drm/i915/display/intel_dsb.c
@@ -6,6 +6,7 @@ 
 
 #include "i915_drv.h"
 #include "intel_display_types.h"
+#include "gem/i915_gem_lmem.h"
 
 #define DSB_BUF_SIZE    (2 * PAGE_SIZE)
 
@@ -113,7 +114,11 @@  intel_dsb_get(struct intel_crtc *crtc)
 
 	wakeref = intel_runtime_pm_get(&i915->runtime_pm);
 
-	obj = i915_gem_object_create_internal(i915, DSB_BUF_SIZE);
+	if (HAS_LMEM(i915))
+		obj = i915_gem_object_create_lmem(i915, DSB_BUF_SIZE, 0);
+	else
+		obj = i915_gem_object_create_internal(i915, DSB_BUF_SIZE);
+
 	if (IS_ERR(obj)) {
 		DRM_ERROR("Gem object creation failed\n");
 		goto out;