From patchwork Wed Mar 5 22:03:44 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 3779621 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E1FE4BF540 for ; Wed, 5 Mar 2014 22:03:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 17ED32024C for ; Wed, 5 Mar 2014 22:03:59 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id E16D020220 for ; Wed, 5 Mar 2014 22:03:57 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A944310577A; Wed, 5 Mar 2014 14:03:55 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qg0-f48.google.com (mail-qg0-f48.google.com [209.85.192.48]) by gabe.freedesktop.org (Postfix) with ESMTP id 86A7310577A for ; Wed, 5 Mar 2014 14:03:53 -0800 (PST) Received: by mail-qg0-f48.google.com with SMTP id j107so4664451qga.7 for ; Wed, 05 Mar 2014 14:03:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=WxkAKhnyr1f0tl7ROdKJJEfwYeV/oSsfBa7AqZ87AxU=; b=q/956CMYBZfALqlqoG1OuBPQ0z8MgEyxwXTKKDpEwkiArl8ExHOuR39AyN2UcLnl3/ YQ4klRAsAhJBrV51WCMW31TGK+KS53pFG7dpHOplgBwfSCxAvumm70W05Y630sA/G3yt UDygt/JhrgNFmuqo3WcZbPiUEmO5/lFoipn/P2NYzccVOJjAWEUfqRgOkApEBnFtatkq wZSQRXRwYURlohKkg4jGFWYiroIDZhd4P4KmMT0wgLw/1w+SNu1m7g07Lpv+LsCqLA5S B6YKCZ5X4Js+sUmSTlhwJWjMJadibH6LQ0JvazH4UyrKGhn/fDKpNGaYNtk0dLLW+aEW VPkQ== X-Received: by 10.224.22.65 with SMTP id m1mr5007387qab.103.1394057032055; Wed, 05 Mar 2014 14:03:52 -0800 (PST) Received: from localhost.localdomain (static-74-96-105-49.washdc.fios.verizon.net. [74.96.105.49]) by mx.google.com with ESMTPSA id 67sm4902616qgr.15.2014.03.05.14.03.51 for (version=TLSv1.2 cipher=AES128-GCM-SHA256 bits=128/128); Wed, 05 Mar 2014 14:03:51 -0800 (PST) From: Alex Deucher To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm/radeon/cs: return an error if no uvd support Date: Wed, 5 Mar 2014 17:03:44 -0500 Message-Id: <1394057024-10597-1-git-send-email-alexander.deucher@amd.com> X-Mailer: git-send-email 1.8.3.1 Cc: Alex Deucher , stable@vger.kernel.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When selecting the engine, return an error if the GPU doesn't have UVD. Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org --- drivers/gpu/drm/radeon/radeon_cs.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/radeon/radeon_cs.c b/drivers/gpu/drm/radeon/radeon_cs.c index dfb5a1d..fa7839b 100644 --- a/drivers/gpu/drm/radeon/radeon_cs.c +++ b/drivers/gpu/drm/radeon/radeon_cs.c @@ -145,7 +145,10 @@ static int radeon_cs_get_ring(struct radeon_cs_parser *p, u32 ring, s32 priority } break; case RADEON_CS_RING_UVD: - p->ring = R600_RING_TYPE_UVD_INDEX; + if (p->rdev->has_uvd) + p->ring = R600_RING_TYPE_UVD_INDEX; + else + return -EINVAL; break; } return 0;