diff mbox

drm/radeon: don't allow RADEON_GEM_DOMAIN_CPU for command submission

Message ID 1401152196-4604-1-git-send-email-maraeo@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Marek Olšák May 27, 2014, 12:56 a.m. UTC
From: Marek Olšák <marek.olsak@amd.com>

It hangs the hardware.

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
---
 drivers/gpu/drm/radeon/radeon_cs.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Christian König May 27, 2014, 9:08 a.m. UTC | #1
Am 27.05.2014 02:56, schrieb Marek Olšák:
> From: Marek Olšák <marek.olsak@amd.com>
>
> It hangs the hardware.
>
> Signed-off-by: Marek Olšák <marek.olsak@amd.com>

Reviewed-by: Christian König <christian.koenig@amd.com>

Maybe CC stable as well? Anyway going to add it to my 3.15 queue.

Christian.

> ---
>   drivers/gpu/drm/radeon/radeon_cs.c | 6 ++++++
>   1 file changed, 6 insertions(+)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_cs.c b/drivers/gpu/drm/radeon/radeon_cs.c
> index 2b6e0eb..2b78191 100644
> --- a/drivers/gpu/drm/radeon/radeon_cs.c
> +++ b/drivers/gpu/drm/radeon/radeon_cs.c
> @@ -152,6 +152,12 @@ static int radeon_cs_parser_relocs(struct radeon_cs_parser *p)
>   			uint32_t domain = r->write_domain ?
>   				r->write_domain : r->read_domains;
>   
> +			if (domain & RADEON_GEM_DOMAIN_CPU) {
> +				DRM_ERROR("RADEON_GEM_DOMAIN_CPU is not valid "
> +					  "for command submission\n");
> +				return -EINVAL;
> +			}
> +
>   			p->relocs[i].domain = domain;
>   			if (domain == RADEON_GEM_DOMAIN_VRAM)
>   				domain |= RADEON_GEM_DOMAIN_GTT;
Marek Olšák May 27, 2014, 12:32 p.m. UTC | #2
Yeah, feel free to add the Cc: stable tag.

Marek

On Tue, May 27, 2014 at 11:08 AM, Christian König
<deathsimple@vodafone.de> wrote:
> Am 27.05.2014 02:56, schrieb Marek Olšák:
>
>> From: Marek Olšák <marek.olsak@amd.com>
>>
>> It hangs the hardware.
>>
>> Signed-off-by: Marek Olšák <marek.olsak@amd.com>
>
>
> Reviewed-by: Christian König <christian.koenig@amd.com>
>
> Maybe CC stable as well? Anyway going to add it to my 3.15 queue.
>
> Christian.
>
>
>> ---
>>   drivers/gpu/drm/radeon/radeon_cs.c | 6 ++++++
>>   1 file changed, 6 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/radeon/radeon_cs.c
>> b/drivers/gpu/drm/radeon/radeon_cs.c
>> index 2b6e0eb..2b78191 100644
>> --- a/drivers/gpu/drm/radeon/radeon_cs.c
>> +++ b/drivers/gpu/drm/radeon/radeon_cs.c
>> @@ -152,6 +152,12 @@ static int radeon_cs_parser_relocs(struct
>> radeon_cs_parser *p)
>>                         uint32_t domain = r->write_domain ?
>>                                 r->write_domain : r->read_domains;
>>   +                     if (domain & RADEON_GEM_DOMAIN_CPU) {
>> +                               DRM_ERROR("RADEON_GEM_DOMAIN_CPU is not
>> valid "
>> +                                         "for command submission\n");
>> +                               return -EINVAL;
>> +                       }
>> +
>>                         p->relocs[i].domain = domain;
>>                         if (domain == RADEON_GEM_DOMAIN_VRAM)
>>                                 domain |= RADEON_GEM_DOMAIN_GTT;
>
>
diff mbox

Patch

diff --git a/drivers/gpu/drm/radeon/radeon_cs.c b/drivers/gpu/drm/radeon/radeon_cs.c
index 2b6e0eb..2b78191 100644
--- a/drivers/gpu/drm/radeon/radeon_cs.c
+++ b/drivers/gpu/drm/radeon/radeon_cs.c
@@ -152,6 +152,12 @@  static int radeon_cs_parser_relocs(struct radeon_cs_parser *p)
 			uint32_t domain = r->write_domain ?
 				r->write_domain : r->read_domains;
 
+			if (domain & RADEON_GEM_DOMAIN_CPU) {
+				DRM_ERROR("RADEON_GEM_DOMAIN_CPU is not valid "
+					  "for command submission\n");
+				return -EINVAL;
+			}
+
 			p->relocs[i].domain = domain;
 			if (domain == RADEON_GEM_DOMAIN_VRAM)
 				domain |= RADEON_GEM_DOMAIN_GTT;