Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add new PRIME type for more memory information #504

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

XinfengZhang
Copy link
Contributor

the additional memory information include memory location and some addtional information

Signed-off-by: Carl Zhang [email protected]

the additional memory information include memory location and some addtional information

Signed-off-by: Carl Zhang <[email protected]>
@fhvwy
Copy link
Contributor

fhvwy commented Mar 7, 2021

The intent of this is to connect to the memory_region stuff in the i915 kernel DRM driver, right? Given that it won't apply to anything other than i915, maybe that should be in the name rather than calling it DRM_PRIME_3 as if it applied to other DRM PRIME cases - something like VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME_I915_MEMORY_REGION, perhaps?

Relatedly, what lies on the other side of this API? Is there a matching OpenCL/Vulkan extension or KMS feature which accepts/provides this information?

union{
struct{
/* whether the memory is allocated on local memory */
uint32_t local_memory :1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does "local memory" mean? Is it memory local to the CPU running the user code, memory local to the device being used, something else?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

memory local to the device being used. it is on chip/device memory.

/* whether the memory is allocated on local memory */
uint32_t local_memory :1;
/* whether the memory region is enabled */
uint32_t memory_region_enable: 1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does it mean for a memory region to be enabled? I can't find any concept like this in the i915 driver.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if there are multiple memory chip, and has different control. it should be true.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure that this flag is actually needed. If there is memory_region_index specified, does not that mean that "memory region is enabled?"

/* whether the memory region is enabled */
uint32_t memory_region_enable: 1;
/* memory region index */
uint32_t memory_region_index: 8;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Index of what? Is this actually the ID of the memory region, as in enum intel_region_id?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the ID of the memory region, sorry , seems it is confusing, because there are already intel_region_id defined. so. maybe I need use other name to distinguish with enum intel_region_id

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there is an index, then there should be a range for this index which does not seem present in this PR. This is confusing and needs a correction: please, specify how to get a range?

@XinfengZhang
Copy link
Contributor Author

The intent of this is to connect to the memory_region stuff in the i915 kernel DRM driver, right? Given that it won't apply to anything other than i915, maybe that should be in the name rather than calling it DRM_PRIME_3 as if it applied to other DRM PRIME cases - something like VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME_I915_MEMORY_REGION, perhaps?

yes, one of the reason is memory_region, but the main purpose is that OCL want us provide the memory location, want to know the surface is allocated on system memory or local memory( on chip/device memory).

new memory type always indicate new structure, right? even we use VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME_I915_MEMORY_REGION, we still need a structure, but the structure also need to contain the information already in VADRMPRIMESurfaceDescriptor. actually, I suppose we forgot to reserve some bytes in VADRMPRIMESurfaceDescriptor.

Relatedly, what lies on the other side of this API? Is there a matching OpenCL/Vulkan extension or KMS feature which accepts/provides this information?

Kernel user api does not provide a interface to query such information though a handle of buffer object. it's why I want to extend VADRMPRIMESurfaceDescriptor. about "Is there a matching OpenCL/Vulkan extension or KMS feature which accepts/provides this information?" I am not sure, need to check.

/* whether the memory region is enabled */
uint32_t memory_region_enable: 1;
/* memory region index */
uint32_t memory_region_index: 8;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there is an index, then there should be a range for this index which does not seem present in this PR. This is confusing and needs a correction: please, specify how to get a range?

/* whether the memory is allocated on local memory */
uint32_t local_memory :1;
/* whether the memory region is enabled */
uint32_t memory_region_enable: 1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure that this flag is actually needed. If there is memory_region_index specified, does not that mean that "memory region is enabled?"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants