From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jerome Glisse Subject: Re: [PATCH 2/2] drm/radeon: add new info ioctl query for hawaii accel Date: Fri, 25 Jul 2014 10:14:13 -0400 Message-ID: <20140725135534.GA2668@gmail.com> References: <1406245907-2567-1-git-send-email-alexander.deucher@amd.com> <1406245907-2567-2-git-send-email-alexander.deucher@amd.com> <53D1BB67.6080403@daenzer.net> <53D1BB95.5070903@daenzer.net> <53D1BFD3.1040100@daenzer.net> <53D223CF.7000409@vodafone.de> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mail-qg0-f54.google.com (mail-qg0-f54.google.com [209.85.192.54]) by gabe.freedesktop.org (Postfix) with ESMTP id 53D536E830 for ; Fri, 25 Jul 2014 07:14:22 -0700 (PDT) Received: by mail-qg0-f54.google.com with SMTP id z60so5087617qgd.13 for ; Fri, 25 Jul 2014 07:14:21 -0700 (PDT) Content-Disposition: inline In-Reply-To: <53D223CF.7000409@vodafone.de> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Christian =?iso-8859-1?Q?K=F6nig?= Cc: Michel =?iso-8859-1?Q?D=E4nzer?= , Maling list - DRI developers List-Id: dri-devel@lists.freedesktop.org On Fri, Jul 25, 2014 at 11:30:55AM +0200, Christian K=F6nig wrote: > Am 25.07.2014 um 05:05 schrieb Alex Deucher: > >On Thu, Jul 24, 2014 at 10:24 PM, Michel D=E4nzer w= rote: > >>On 25.07.2014 11:06, Michel D=E4nzer wrote: > >>>On 25.07.2014 11:05, Michel D=E4nzer wrote: > >>>>On 25.07.2014 08:51, Alex Deucher wrote: > >>>>>We need to make sure we have a new enough firmware with > >>>>>the fixed nop packet. > >>>>> > >>>>>Signed-off-by: Alex Deucher > >>>>>--- > >>>>> drivers/gpu/drm/radeon/radeon_kms.c | 6 ++++++ > >>>>> include/uapi/drm/radeon_drm.h | 1 + > >>>>> 2 files changed, 7 insertions(+) > >>>>> > >>>>>diff --git a/drivers/gpu/drm/radeon/radeon_kms.c b/drivers/gpu/drm/r= adeon/radeon_kms.c > >>>>>index 35d9318..3ea9f59 100644 > >>>>>--- a/drivers/gpu/drm/radeon/radeon_kms.c > >>>>>+++ b/drivers/gpu/drm/radeon/radeon_kms.c > >>>>>@@ -529,6 +529,12 @@ static int radeon_info_ioctl(struct drm_device = *dev, void *data, struct drm_file > >>>>> else > >>>>> *value =3D 1; > >>>>> break; > >>>>>+ case RADEON_INFO_HAWAII_ACCEL: > >>>>>+ if (rdev->new_fw) > >>>>>+ *value =3D 1; > >>>>>+ else > >>>>>+ *value =3D 0; > >>>>>+ 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 509b2d7..a41dec3 100644 > >>>>>--- a/include/uapi/drm/radeon_drm.h > >>>>>+++ b/include/uapi/drm/radeon_drm.h > >>>>>@@ -1010,6 +1010,7 @@ struct drm_radeon_cs { > >>>>> #define RADEON_INFO_VRAM_USAGE 0x1e > >>>>> #define RADEON_INFO_GTT_USAGE 0x1f > >>>>> #define RADEON_INFO_ACTIVE_CU_COUNT 0x20 > >>>>>+#define RADEON_INFO_HAWAII_ACCEL 0x21 > >>>>> > >>>>> struct drm_radeon_info { > >>>>> uint32_t request; > >>>>> > >>>>Please make the RADEON_INFO_ACCEL_WORKING(2) ioctl do the right thing > >>>>for Hawaii instead of adding yet another one. > >>>Ugh, s/ioctl/info query/ of course. > >>Hmm, I guess that doesn't work because older kernels returned 1 for > >>those on Hawaii... > >Right. The hawaii problems came down to two things: > > > >1. missing tiling info setup (fixed with Jerome's patch: > >http://cgit.freedesktop.org/~agd5f/linux/commit/?h=3Ddrm-next-3.17-wip&i= d=3D78e758aa27d9d430c61999160ddf72e829c5cf26) > >for hawaii. This was due to merging hawaii support after we fixed up > >CI tiling. Dave already merged this and it should show up in stable. > > > >2. The current Hawaii CP firmware doesn't support the special case > >0xffff1000 type 3 NOP packet. The newer firmware version I added > >support for in 3.17 supports this packet. > > > >So we can either patch mesa to use the type 2 packets for now and > >allow it to work with kernels with older firmware. The problem is the > >compute rings don't support type 2 packets anymore and they are > >deprecated on gfx, plus we'd still have to deal with existing versions > >of mesa that still use the problematic packet. > > > >It just seemed easier to add a new kernel check. > = > Can we still make the check a bit more generic? E.g. not so HAWAII specif= ic > name and maybe returning more information from the new firmware header? > = > Something like this, > Christian. I would rather not add anything, let just dump drm version in 3.17 and use that to enable compute and in mean time disable compute for hawaii but enab= le gfx if we detect 3.16. This would be a lot cleaner and no need for yet anot= her get_info ie we make 3.17 only report accel if new firmware is detected. Cheers, J=E9r=F4me