diff mbox

drm/radeon: add ring working query

Message ID 1365511499-14685-1-git-send-email-deathsimple@vodafone.de (mailing list archive)
State New, archived
Headers show

Commit Message

Christian König April 9, 2013, 12:44 p.m. UTC
From: Christian König <christian.koenig@amd.com>

Add new ioctl option and bumb minor version number.

Signed-off-by: Christian König <christian.koenig@amd.com>
---
 drivers/gpu/drm/radeon/radeon_drv.c |    2 +-
 drivers/gpu/drm/radeon/radeon_kms.c |   17 +++++++++++++++++
 include/uapi/drm/radeon_drm.h       |    2 ++
 3 files changed, 20 insertions(+), 1 deletion(-)

Comments

Jerome Glisse April 9, 2013, 2:13 p.m. UTC | #1
On Tue, Apr 9, 2013 at 8:44 AM, Christian König <deathsimple@vodafone.de>wrote:

> From: Christian König <christian.koenig@amd.com>
>
> Add new ioctl option and bumb minor version number.
>

I already have the tiling patch that bump the version, but i think it's
just a matter for Alex.

Reviewed-by: Jerome Glisse <jglisse@redhat.com>


>
> Signed-off-by: Christian König <christian.koenig@amd.com>
> ---
>  drivers/gpu/drm/radeon/radeon_drv.c |    2 +-
>  drivers/gpu/drm/radeon/radeon_kms.c |   17 +++++++++++++++++
>  include/uapi/drm/radeon_drm.h       |    2 ++
>  3 files changed, 20 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_drv.c
> b/drivers/gpu/drm/radeon/radeon_drv.c
> index 66a7f0f..31b193b 100644
> --- a/drivers/gpu/drm/radeon/radeon_drv.c
> +++ b/drivers/gpu/drm/radeon/radeon_drv.c
> @@ -73,7 +73,7 @@
>   *   2.30.0 - fix for FMASK texturing
>   */
>  #define KMS_DRIVER_MAJOR       2
> -#define KMS_DRIVER_MINOR       30
> +#define KMS_DRIVER_MINOR       31
>  #define KMS_DRIVER_PATCHLEVEL  0
>  int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags);
>  int radeon_driver_unload_kms(struct drm_device *dev);
> diff --git a/drivers/gpu/drm/radeon/radeon_kms.c
> b/drivers/gpu/drm/radeon/radeon_kms.c
> index 3019759..8cb9d12 100644
> --- a/drivers/gpu/drm/radeon/radeon_kms.c
> +++ b/drivers/gpu/drm/radeon/radeon_kms.c
> @@ -376,6 +376,23 @@ int radeon_info_ioctl(struct drm_device *dev, void
> *data, struct drm_file *filp)
>                 else
>                         return -EINVAL;
>                 break;
> +       case RADEON_INFO_RING_WORKING:
> +               switch (value) {
> +               case RADEON_CS_RING_GFX:
> +               case RADEON_CS_RING_COMPUTE:
> +                       value =
> rdev->ring[RADEON_RING_TYPE_GFX_INDEX].ready;
> +                       break;
> +               case RADEON_CS_RING_DMA:
> +                       value = rdev->ring[R600_RING_TYPE_DMA_INDEX].ready;
> +                       value |=
> rdev->ring[CAYMAN_RING_TYPE_DMA1_INDEX].ready;
> +                       break;
> +               case RADEON_CS_RING_UVD:
> +                       value = rdev->ring[R600_RING_TYPE_UVD_INDEX].ready;
> +                       break;
> +               default:
> +                       return -EINVAL;
> +               }
> +               break;
>         default:
>                 DRM_DEBUG_KMS("Invalid request %d\n", info->request);
>                 return -EINVAL;
> diff --git a/include/uapi/drm/radeon_drm.h b/include/uapi/drm/radeon_drm.h
> index cd085d1..8459415 100644
> --- a/include/uapi/drm/radeon_drm.h
> +++ b/include/uapi/drm/radeon_drm.h
> @@ -973,6 +973,8 @@ struct drm_radeon_cs {
>  #define RADEON_INFO_MAX_SE             0x12
>  /* max SH per SE */
>  #define RADEON_INFO_MAX_SH_PER_SE      0x13
> +/* query if a RADEON_CS_RING_* submission is supported */
> +#define RADEON_INFO_RING_WORKING       0x14
>
>  struct drm_radeon_info {
>         uint32_t                request;
> --
> 1.7.9.5
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>
Alex Deucher April 9, 2013, 2:26 p.m. UTC | #2
On Tue, Apr 9, 2013 at 10:13 AM, Jerome Glisse <j.glisse@gmail.com> wrote:
>
> On Tue, Apr 9, 2013 at 8:44 AM, Christian König <deathsimple@vodafone.de> wrote:
>>
>> From: Christian König <christian.koenig@amd.com>
>>
>> Add new ioctl option and bumb minor version number.
>
>
> I already have the tiling patch that bump the version, but i think it's just a matter for Alex.

I'll take care of it.

Alex

>
> Reviewed-by: Jerome Glisse <jglisse@redhat.com>
>
>>
>>
>> Signed-off-by: Christian König <christian.koenig@amd.com>
>> ---
>>  drivers/gpu/drm/radeon/radeon_drv.c |    2 +-
>>  drivers/gpu/drm/radeon/radeon_kms.c |   17 +++++++++++++++++
>>  include/uapi/drm/radeon_drm.h       |    2 ++
>>  3 files changed, 20 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c
>> index 66a7f0f..31b193b 100644
>> --- a/drivers/gpu/drm/radeon/radeon_drv.c
>> +++ b/drivers/gpu/drm/radeon/radeon_drv.c
>> @@ -73,7 +73,7 @@
>>   *   2.30.0 - fix for FMASK texturing
>>   */
>>  #define KMS_DRIVER_MAJOR       2
>> -#define KMS_DRIVER_MINOR       30
>> +#define KMS_DRIVER_MINOR       31
>>  #define KMS_DRIVER_PATCHLEVEL  0
>>  int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags);
>>  int radeon_driver_unload_kms(struct drm_device *dev);
>> diff --git a/drivers/gpu/drm/radeon/radeon_kms.c b/drivers/gpu/drm/radeon/radeon_kms.c
>> index 3019759..8cb9d12 100644
>> --- a/drivers/gpu/drm/radeon/radeon_kms.c
>> +++ b/drivers/gpu/drm/radeon/radeon_kms.c
>> @@ -376,6 +376,23 @@ int radeon_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
>>                 else
>>                         return -EINVAL;
>>                 break;
>> +       case RADEON_INFO_RING_WORKING:
>> +               switch (value) {
>> +               case RADEON_CS_RING_GFX:
>> +               case RADEON_CS_RING_COMPUTE:
>> +                       value = rdev->ring[RADEON_RING_TYPE_GFX_INDEX].ready;
>> +                       break;
>> +               case RADEON_CS_RING_DMA:
>> +                       value = rdev->ring[R600_RING_TYPE_DMA_INDEX].ready;
>> +                       value |= rdev->ring[CAYMAN_RING_TYPE_DMA1_INDEX].ready;
>> +                       break;
>> +               case RADEON_CS_RING_UVD:
>> +                       value = rdev->ring[R600_RING_TYPE_UVD_INDEX].ready;
>> +                       break;
>> +               default:
>> +                       return -EINVAL;
>> +               }
>> +               break;
>>         default:
>>                 DRM_DEBUG_KMS("Invalid request %d\n", info->request);
>>                 return -EINVAL;
>> diff --git a/include/uapi/drm/radeon_drm.h b/include/uapi/drm/radeon_drm.h
>> index cd085d1..8459415 100644
>> --- a/include/uapi/drm/radeon_drm.h
>> +++ b/include/uapi/drm/radeon_drm.h
>> @@ -973,6 +973,8 @@ struct drm_radeon_cs {
>>  #define RADEON_INFO_MAX_SE             0x12
>>  /* max SH per SE */
>>  #define RADEON_INFO_MAX_SH_PER_SE      0x13
>> +/* query if a RADEON_CS_RING_* submission is supported */
>> +#define RADEON_INFO_RING_WORKING       0x14
>>
>>  struct drm_radeon_info {
>>         uint32_t                request;
>> --
>> 1.7.9.5
>>
>> _______________________________________________
>> dri-devel mailing list
>> dri-devel@lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>
>
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>

On Tue, Apr 9, 2013 at 10:13 AM, Jerome Glisse <j.glisse@gmail.com> wrote:
> On Tue, Apr 9, 2013 at 8:44 AM, Christian König <deathsimple@vodafone.de>
> wrote:
>>
>> From: Christian König <christian.koenig@amd.com>
>>
>> Add new ioctl option and bumb minor version number.
>
>
> I already have the tiling patch that bump the version, but i think it's just
> a matter for Alex.
>
> Reviewed-by: Jerome Glisse <jglisse@redhat.com>
>
>>
>>
>> Signed-off-by: Christian König <christian.koenig@amd.com>
>> ---
>>  drivers/gpu/drm/radeon/radeon_drv.c |    2 +-
>>  drivers/gpu/drm/radeon/radeon_kms.c |   17 +++++++++++++++++
>>  include/uapi/drm/radeon_drm.h       |    2 ++
>>  3 files changed, 20 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/radeon/radeon_drv.c
>> b/drivers/gpu/drm/radeon/radeon_drv.c
>> index 66a7f0f..31b193b 100644
>> --- a/drivers/gpu/drm/radeon/radeon_drv.c
>> +++ b/drivers/gpu/drm/radeon/radeon_drv.c
>> @@ -73,7 +73,7 @@
>>   *   2.30.0 - fix for FMASK texturing
>>   */
>>  #define KMS_DRIVER_MAJOR       2
>> -#define KMS_DRIVER_MINOR       30
>> +#define KMS_DRIVER_MINOR       31
>>  #define KMS_DRIVER_PATCHLEVEL  0
>>  int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags);
>>  int radeon_driver_unload_kms(struct drm_device *dev);
>> diff --git a/drivers/gpu/drm/radeon/radeon_kms.c
>> b/drivers/gpu/drm/radeon/radeon_kms.c
>> index 3019759..8cb9d12 100644
>> --- a/drivers/gpu/drm/radeon/radeon_kms.c
>> +++ b/drivers/gpu/drm/radeon/radeon_kms.c
>> @@ -376,6 +376,23 @@ int radeon_info_ioctl(struct drm_device *dev, void
>> *data, struct drm_file *filp)
>>                 else
>>                         return -EINVAL;
>>                 break;
>> +       case RADEON_INFO_RING_WORKING:
>> +               switch (value) {
>> +               case RADEON_CS_RING_GFX:
>> +               case RADEON_CS_RING_COMPUTE:
>> +                       value =
>> rdev->ring[RADEON_RING_TYPE_GFX_INDEX].ready;
>> +                       break;
>> +               case RADEON_CS_RING_DMA:
>> +                       value =
>> rdev->ring[R600_RING_TYPE_DMA_INDEX].ready;
>> +                       value |=
>> rdev->ring[CAYMAN_RING_TYPE_DMA1_INDEX].ready;
>> +                       break;
>> +               case RADEON_CS_RING_UVD:
>> +                       value =
>> rdev->ring[R600_RING_TYPE_UVD_INDEX].ready;
>> +                       break;
>> +               default:
>> +                       return -EINVAL;
>> +               }
>> +               break;
>>         default:
>>                 DRM_DEBUG_KMS("Invalid request %d\n", info->request);
>>                 return -EINVAL;
>> diff --git a/include/uapi/drm/radeon_drm.h b/include/uapi/drm/radeon_drm.h
>> index cd085d1..8459415 100644
>> --- a/include/uapi/drm/radeon_drm.h
>> +++ b/include/uapi/drm/radeon_drm.h
>> @@ -973,6 +973,8 @@ struct drm_radeon_cs {
>>  #define RADEON_INFO_MAX_SE             0x12
>>  /* max SH per SE */
>>  #define RADEON_INFO_MAX_SH_PER_SE      0x13
>> +/* query if a RADEON_CS_RING_* submission is supported */
>> +#define RADEON_INFO_RING_WORKING       0x14
>>
>>  struct drm_radeon_info {
>>         uint32_t                request;
>> --
>> 1.7.9.5
>>
>> _______________________________________________
>> dri-devel mailing list
>> dri-devel@lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>
>
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>
Christian König April 9, 2013, 5:10 p.m. UTC | #3
Am 09.04.2013 16:26, schrieb Alex Deucher:
> On Tue, Apr 9, 2013 at 10:13 AM, Jerome Glisse <j.glisse@gmail.com> wrote:
>> On Tue, Apr 9, 2013 at 8:44 AM, Christian König <deathsimple@vodafone.de> wrote:
>>> From: Christian König <christian.koenig@amd.com>
>>>
>>> Add new ioctl option and bumb minor version number.
>>
>> I already have the tiling patch that bump the version, but i think it's just a matter for Alex.
> I'll take care of it.

IIRC we also have another internal patch that wants to bumb the version 
number.

Alex could you start with a drm-next-3.10 branch and try to merge all 
that stuff?

Thanks,
Christian.

> Alex
>
>> Reviewed-by: Jerome Glisse <jglisse@redhat.com>
>>
>>>
>>> Signed-off-by: Christian König <christian.koenig@amd.com>
>>> ---
>>>   drivers/gpu/drm/radeon/radeon_drv.c |    2 +-
>>>   drivers/gpu/drm/radeon/radeon_kms.c |   17 +++++++++++++++++
>>>   include/uapi/drm/radeon_drm.h       |    2 ++
>>>   3 files changed, 20 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c
>>> index 66a7f0f..31b193b 100644
>>> --- a/drivers/gpu/drm/radeon/radeon_drv.c
>>> +++ b/drivers/gpu/drm/radeon/radeon_drv.c
>>> @@ -73,7 +73,7 @@
>>>    *   2.30.0 - fix for FMASK texturing
>>>    */
>>>   #define KMS_DRIVER_MAJOR       2
>>> -#define KMS_DRIVER_MINOR       30
>>> +#define KMS_DRIVER_MINOR       31
>>>   #define KMS_DRIVER_PATCHLEVEL  0
>>>   int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags);
>>>   int radeon_driver_unload_kms(struct drm_device *dev);
>>> diff --git a/drivers/gpu/drm/radeon/radeon_kms.c b/drivers/gpu/drm/radeon/radeon_kms.c
>>> index 3019759..8cb9d12 100644
>>> --- a/drivers/gpu/drm/radeon/radeon_kms.c
>>> +++ b/drivers/gpu/drm/radeon/radeon_kms.c
>>> @@ -376,6 +376,23 @@ int radeon_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
>>>                  else
>>>                          return -EINVAL;
>>>                  break;
>>> +       case RADEON_INFO_RING_WORKING:
>>> +               switch (value) {
>>> +               case RADEON_CS_RING_GFX:
>>> +               case RADEON_CS_RING_COMPUTE:
>>> +                       value = rdev->ring[RADEON_RING_TYPE_GFX_INDEX]..ready;
>>> +                       break;
>>> +               case RADEON_CS_RING_DMA:
>>> +                       value = rdev->ring[R600_RING_TYPE_DMA_INDEX].ready;
>>> +                       value |= rdev->ring[CAYMAN_RING_TYPE_DMA1_INDEX].ready;
>>> +                       break;
>>> +               case RADEON_CS_RING_UVD:
>>> +                       value = rdev->ring[R600_RING_TYPE_UVD_INDEX].ready;
>>> +                       break;
>>> +               default:
>>> +                       return -EINVAL;
>>> +               }
>>> +               break;
>>>          default:
>>>                  DRM_DEBUG_KMS("Invalid request %d\n", info->request);
>>>                  return -EINVAL;
>>> diff --git a/include/uapi/drm/radeon_drm.h b/include/uapi/drm/radeon_drm..h
>>> index cd085d1..8459415 100644
>>> --- a/include/uapi/drm/radeon_drm.h
>>> +++ b/include/uapi/drm/radeon_drm.h
>>> @@ -973,6 +973,8 @@ struct drm_radeon_cs {
>>>   #define RADEON_INFO_MAX_SE             0x12
>>>   /* max SH per SE */
>>>   #define RADEON_INFO_MAX_SH_PER_SE      0x13
>>> +/* query if a RADEON_CS_RING_* submission is supported */
>>> +#define RADEON_INFO_RING_WORKING       0x14
>>>
>>>   struct drm_radeon_info {
>>>          uint32_t                request;
>>> --
>>> 1.7.9.5
>>>
>>> _______________________________________________
>>> dri-devel mailing list
>>> dri-devel@lists.freedesktop.org
>>> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>>
>>
>> _______________________________________________
>> dri-devel mailing list
>> dri-devel@lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>>
> On Tue, Apr 9, 2013 at 10:13 AM, Jerome Glisse <j.glisse@gmail.com> wrote:
>> On Tue, Apr 9, 2013 at 8:44 AM, Christian König <deathsimple@vodafone.de>
>> wrote:
>>> From: Christian König <christian.koenig@amd.com>
>>>
>>> Add new ioctl option and bumb minor version number.
>>
>> I already have the tiling patch that bump the version, but i think it's just
>> a matter for Alex.
>>
>> Reviewed-by: Jerome Glisse <jglisse@redhat.com>
>>
>>>
>>> Signed-off-by: Christian König <christian.koenig@amd.com>
>>> ---
>>>   drivers/gpu/drm/radeon/radeon_drv.c |    2 +-
>>>   drivers/gpu/drm/radeon/radeon_kms.c |   17 +++++++++++++++++
>>>   include/uapi/drm/radeon_drm.h       |    2 ++
>>>   3 files changed, 20 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/gpu/drm/radeon/radeon_drv.c
>>> b/drivers/gpu/drm/radeon/radeon_drv.c
>>> index 66a7f0f..31b193b 100644
>>> --- a/drivers/gpu/drm/radeon/radeon_drv.c
>>> +++ b/drivers/gpu/drm/radeon/radeon_drv.c
>>> @@ -73,7 +73,7 @@
>>>    *   2.30.0 - fix for FMASK texturing
>>>    */
>>>   #define KMS_DRIVER_MAJOR       2
>>> -#define KMS_DRIVER_MINOR       30
>>> +#define KMS_DRIVER_MINOR       31
>>>   #define KMS_DRIVER_PATCHLEVEL  0
>>>   int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags);
>>>   int radeon_driver_unload_kms(struct drm_device *dev);
>>> diff --git a/drivers/gpu/drm/radeon/radeon_kms.c
>>> b/drivers/gpu/drm/radeon/radeon_kms.c
>>> index 3019759..8cb9d12 100644
>>> --- a/drivers/gpu/drm/radeon/radeon_kms.c
>>> +++ b/drivers/gpu/drm/radeon/radeon_kms.c
>>> @@ -376,6 +376,23 @@ int radeon_info_ioctl(struct drm_device *dev, void
>>> *data, struct drm_file *filp)
>>>                  else
>>>                          return -EINVAL;
>>>                  break;
>>> +       case RADEON_INFO_RING_WORKING:
>>> +               switch (value) {
>>> +               case RADEON_CS_RING_GFX:
>>> +               case RADEON_CS_RING_COMPUTE:
>>> +                       value =
>>> rdev->ring[RADEON_RING_TYPE_GFX_INDEX].ready;
>>> +                       break;
>>> +               case RADEON_CS_RING_DMA:
>>> +                       value =
>>> rdev->ring[R600_RING_TYPE_DMA_INDEX].ready;
>>> +                       value |=
>>> rdev->ring[CAYMAN_RING_TYPE_DMA1_INDEX].ready;
>>> +                       break;
>>> +               case RADEON_CS_RING_UVD:
>>> +                       value =
>>> rdev->ring[R600_RING_TYPE_UVD_INDEX].ready;
>>> +                       break;
>>> +               default:
>>> +                       return -EINVAL;
>>> +               }
>>> +               break;
>>>          default:
>>>                  DRM_DEBUG_KMS("Invalid request %d\n", info->request);
>>>                  return -EINVAL;
>>> diff --git a/include/uapi/drm/radeon_drm.h b/include/uapi/drm/radeon_drm..h
>>> index cd085d1..8459415 100644
>>> --- a/include/uapi/drm/radeon_drm.h
>>> +++ b/include/uapi/drm/radeon_drm.h
>>> @@ -973,6 +973,8 @@ struct drm_radeon_cs {
>>>   #define RADEON_INFO_MAX_SE             0x12
>>>   /* max SH per SE */
>>>   #define RADEON_INFO_MAX_SH_PER_SE      0x13
>>> +/* query if a RADEON_CS_RING_* submission is supported */
>>> +#define RADEON_INFO_RING_WORKING       0x14
>>>
>>>   struct drm_radeon_info {
>>>          uint32_t                request;
>>> --
>>> 1.7.9.5
>>>
>>> _______________________________________________
>>> dri-devel mailing list
>>> dri-devel@lists.freedesktop.org
>>> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>>
>>
>> _______________________________________________
>> dri-devel mailing list
>> dri-devel@lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>>
Alex Deucher April 9, 2013, 5:14 p.m. UTC | #4
On Tue, Apr 9, 2013 at 1:10 PM, Christian König <deathsimple@vodafone.de> wrote:
> Am 09.04.2013 16:26, schrieb Alex Deucher:
>
>> On Tue, Apr 9, 2013 at 10:13 AM, Jerome Glisse <j.glisse@gmail.com> wrote:
>>>
>>> On Tue, Apr 9, 2013 at 8:44 AM, Christian König <deathsimple@vodafone.de>
>>> wrote:
>>>>
>>>> From: Christian König <christian.koenig@amd.com>
>>>>
>>>> Add new ioctl option and bumb minor version number.
>>>
>>>
>>> I already have the tiling patch that bump the version, but i think it's
>>> just a matter for Alex.
>>
>> I'll take care of it.
>
>
> IIRC we also have another internal patch that wants to bumb the version
> number.
>
> Alex could you start with a drm-next-3.10 branch and try to merge all that
> stuff?

Yes, I'm working on a 3.10 branch today.  I'll post it as soon as I've
finished merging everything.

Alex

>
> Thanks,
> Christian.
>
>> Alex
>>
>>> Reviewed-by: Jerome Glisse <jglisse@redhat.com>
>>>
>>>>
>>>> Signed-off-by: Christian König <christian.koenig@amd.com>
>>>> ---
>>>>   drivers/gpu/drm/radeon/radeon_drv.c |    2 +-
>>>>   drivers/gpu/drm/radeon/radeon_kms.c |   17 +++++++++++++++++
>>>>   include/uapi/drm/radeon_drm.h       |    2 ++
>>>>   3 files changed, 20 insertions(+), 1 deletion(-)
>>>>
>>>> diff --git a/drivers/gpu/drm/radeon/radeon_drv.c
>>>> b/drivers/gpu/drm/radeon/radeon_drv.c
>>>> index 66a7f0f..31b193b 100644
>>>> --- a/drivers/gpu/drm/radeon/radeon_drv.c
>>>> +++ b/drivers/gpu/drm/radeon/radeon_drv.c
>>>> @@ -73,7 +73,7 @@
>>>>    *   2.30.0 - fix for FMASK texturing
>>>>    */
>>>>   #define KMS_DRIVER_MAJOR       2
>>>> -#define KMS_DRIVER_MINOR       30
>>>> +#define KMS_DRIVER_MINOR       31
>>>>   #define KMS_DRIVER_PATCHLEVEL  0
>>>>   int radeon_driver_load_kms(struct drm_device *dev, unsigned long
>>>> flags);
>>>>   int radeon_driver_unload_kms(struct drm_device *dev);
>>>> diff --git a/drivers/gpu/drm/radeon/radeon_kms.c
>>>> b/drivers/gpu/drm/radeon/radeon_kms.c
>>>> index 3019759..8cb9d12 100644
>>>> --- a/drivers/gpu/drm/radeon/radeon_kms.c
>>>> +++ b/drivers/gpu/drm/radeon/radeon_kms.c
>>>> @@ -376,6 +376,23 @@ int radeon_info_ioctl(struct drm_device *dev, void
>>>> *data, struct drm_file *filp)
>>>>                  else
>>>>                          return -EINVAL;
>>>>                  break;
>>>> +       case RADEON_INFO_RING_WORKING:
>>>> +               switch (value) {
>>>> +               case RADEON_CS_RING_GFX:
>>>> +               case RADEON_CS_RING_COMPUTE:
>>>> +                       value =
>>>> rdev->ring[RADEON_RING_TYPE_GFX_INDEX]..ready;
>>>>
>>>> +                       break;
>>>> +               case RADEON_CS_RING_DMA:
>>>> +                       value =
>>>> rdev->ring[R600_RING_TYPE_DMA_INDEX].ready;
>>>> +                       value |=
>>>> rdev->ring[CAYMAN_RING_TYPE_DMA1_INDEX].ready;
>>>> +                       break;
>>>> +               case RADEON_CS_RING_UVD:
>>>> +                       value =
>>>> rdev->ring[R600_RING_TYPE_UVD_INDEX].ready;
>>>> +                       break;
>>>> +               default:
>>>> +                       return -EINVAL;
>>>> +               }
>>>> +               break;
>>>>          default:
>>>>                  DRM_DEBUG_KMS("Invalid request %d\n", info->request);
>>>>                  return -EINVAL;
>>>> diff --git a/include/uapi/drm/radeon_drm.h
>>>> b/include/uapi/drm/radeon_drm..h
>>>>
>>>> index cd085d1..8459415 100644
>>>> --- a/include/uapi/drm/radeon_drm.h
>>>> +++ b/include/uapi/drm/radeon_drm.h
>>>> @@ -973,6 +973,8 @@ struct drm_radeon_cs {
>>>>   #define RADEON_INFO_MAX_SE             0x12
>>>>   /* max SH per SE */
>>>>   #define RADEON_INFO_MAX_SH_PER_SE      0x13
>>>> +/* query if a RADEON_CS_RING_* submission is supported */
>>>> +#define RADEON_INFO_RING_WORKING       0x14
>>>>
>>>>   struct drm_radeon_info {
>>>>          uint32_t                request;
>>>> --
>>>> 1.7.9.5
>>>>
>>>> _______________________________________________
>>>> dri-devel mailing list
>>>> dri-devel@lists.freedesktop.org
>>>> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>>>
>>>
>>>
>>> _______________________________________________
>>> dri-devel mailing list
>>> dri-devel@lists.freedesktop.org
>>> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>>>
>> On Tue, Apr 9, 2013 at 10:13 AM, Jerome Glisse <j.glisse@gmail.com> wrote:
>>>
>>> On Tue, Apr 9, 2013 at 8:44 AM, Christian König <deathsimple@vodafone.de>
>>> wrote:
>>>>
>>>> From: Christian König <christian.koenig@amd.com>
>>>>
>>>> Add new ioctl option and bumb minor version number.
>>>
>>>
>>> I already have the tiling patch that bump the version, but i think it's
>>> just
>>> a matter for Alex.
>>>
>>> Reviewed-by: Jerome Glisse <jglisse@redhat.com>
>>>
>>>>
>>>> Signed-off-by: Christian König <christian.koenig@amd.com>
>>>> ---
>>>>   drivers/gpu/drm/radeon/radeon_drv.c |    2 +-
>>>>   drivers/gpu/drm/radeon/radeon_kms.c |   17 +++++++++++++++++
>>>>   include/uapi/drm/radeon_drm.h       |    2 ++
>>>>   3 files changed, 20 insertions(+), 1 deletion(-)
>>>>
>>>> diff --git a/drivers/gpu/drm/radeon/radeon_drv.c
>>>> b/drivers/gpu/drm/radeon/radeon_drv.c
>>>> index 66a7f0f..31b193b 100644
>>>> --- a/drivers/gpu/drm/radeon/radeon_drv.c
>>>> +++ b/drivers/gpu/drm/radeon/radeon_drv.c
>>>> @@ -73,7 +73,7 @@
>>>>    *   2.30.0 - fix for FMASK texturing
>>>>    */
>>>>   #define KMS_DRIVER_MAJOR       2
>>>> -#define KMS_DRIVER_MINOR       30
>>>> +#define KMS_DRIVER_MINOR       31
>>>>   #define KMS_DRIVER_PATCHLEVEL  0
>>>>   int radeon_driver_load_kms(struct drm_device *dev, unsigned long
>>>> flags);
>>>>   int radeon_driver_unload_kms(struct drm_device *dev);
>>>> diff --git a/drivers/gpu/drm/radeon/radeon_kms.c
>>>> b/drivers/gpu/drm/radeon/radeon_kms.c
>>>> index 3019759..8cb9d12 100644
>>>> --- a/drivers/gpu/drm/radeon/radeon_kms.c
>>>> +++ b/drivers/gpu/drm/radeon/radeon_kms.c
>>>> @@ -376,6 +376,23 @@ int radeon_info_ioctl(struct drm_device *dev, void
>>>> *data, struct drm_file *filp)
>>>>                  else
>>>>                          return -EINVAL;
>>>>                  break;
>>>> +       case RADEON_INFO_RING_WORKING:
>>>> +               switch (value) {
>>>> +               case RADEON_CS_RING_GFX:
>>>> +               case RADEON_CS_RING_COMPUTE:
>>>> +                       value =
>>>> rdev->ring[RADEON_RING_TYPE_GFX_INDEX].ready;
>>>> +                       break;
>>>> +               case RADEON_CS_RING_DMA:
>>>> +                       value =
>>>> rdev->ring[R600_RING_TYPE_DMA_INDEX].ready;
>>>> +                       value |=
>>>> rdev->ring[CAYMAN_RING_TYPE_DMA1_INDEX].ready;
>>>> +                       break;
>>>> +               case RADEON_CS_RING_UVD:
>>>> +                       value =
>>>> rdev->ring[R600_RING_TYPE_UVD_INDEX].ready;
>>>> +                       break;
>>>> +               default:
>>>> +                       return -EINVAL;
>>>> +               }
>>>> +               break;
>>>>          default:
>>>>                  DRM_DEBUG_KMS("Invalid request %d\n", info->request);
>>>>                  return -EINVAL;
>>>> diff --git a/include/uapi/drm/radeon_drm.h
>>>> b/include/uapi/drm/radeon_drm..h
>>>>
>>>> index cd085d1..8459415 100644
>>>> --- a/include/uapi/drm/radeon_drm.h
>>>> +++ b/include/uapi/drm/radeon_drm.h
>>>> @@ -973,6 +973,8 @@ struct drm_radeon_cs {
>>>>   #define RADEON_INFO_MAX_SE             0x12
>>>>   /* max SH per SE */
>>>>   #define RADEON_INFO_MAX_SH_PER_SE      0x13
>>>> +/* query if a RADEON_CS_RING_* submission is supported */
>>>> +#define RADEON_INFO_RING_WORKING       0x14
>>>>
>>>>   struct drm_radeon_info {
>>>>          uint32_t                request;
>>>> --
>>>> 1.7.9.5
>>>>
>>>> _______________________________________________
>>>> dri-devel mailing list
>>>> dri-devel@lists.freedesktop.org
>>>> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>>>
>>>
>>>
>>> _______________________________________________
>>> dri-devel mailing list
>>> dri-devel@lists.freedesktop.org
>>> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>>>
>
diff mbox

Patch

diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c
index 66a7f0f..31b193b 100644
--- a/drivers/gpu/drm/radeon/radeon_drv.c
+++ b/drivers/gpu/drm/radeon/radeon_drv.c
@@ -73,7 +73,7 @@ 
  *   2.30.0 - fix for FMASK texturing
  */
 #define KMS_DRIVER_MAJOR	2
-#define KMS_DRIVER_MINOR	30
+#define KMS_DRIVER_MINOR	31
 #define KMS_DRIVER_PATCHLEVEL	0
 int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags);
 int radeon_driver_unload_kms(struct drm_device *dev);
diff --git a/drivers/gpu/drm/radeon/radeon_kms.c b/drivers/gpu/drm/radeon/radeon_kms.c
index 3019759..8cb9d12 100644
--- a/drivers/gpu/drm/radeon/radeon_kms.c
+++ b/drivers/gpu/drm/radeon/radeon_kms.c
@@ -376,6 +376,23 @@  int radeon_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
 		else
 			return -EINVAL;
 		break;
+	case RADEON_INFO_RING_WORKING:
+		switch (value) {
+		case RADEON_CS_RING_GFX:
+		case RADEON_CS_RING_COMPUTE:
+			value = rdev->ring[RADEON_RING_TYPE_GFX_INDEX].ready;
+			break;
+		case RADEON_CS_RING_DMA:
+			value = rdev->ring[R600_RING_TYPE_DMA_INDEX].ready;
+			value |= rdev->ring[CAYMAN_RING_TYPE_DMA1_INDEX].ready;
+			break;
+		case RADEON_CS_RING_UVD:
+			value = rdev->ring[R600_RING_TYPE_UVD_INDEX].ready;
+			break;
+		default:
+			return -EINVAL;
+		}
+		break;
 	default:
 		DRM_DEBUG_KMS("Invalid request %d\n", info->request);
 		return -EINVAL;
diff --git a/include/uapi/drm/radeon_drm.h b/include/uapi/drm/radeon_drm.h
index cd085d1..8459415 100644
--- a/include/uapi/drm/radeon_drm.h
+++ b/include/uapi/drm/radeon_drm.h
@@ -973,6 +973,8 @@  struct drm_radeon_cs {
 #define RADEON_INFO_MAX_SE		0x12
 /* max SH per SE */
 #define RADEON_INFO_MAX_SH_PER_SE	0x13
+/* query if a RADEON_CS_RING_* submission is supported */
+#define RADEON_INFO_RING_WORKING	0x14
 
 struct drm_radeon_info {
 	uint32_t		request;