From patchwork Tue Jan 29 08:57:03 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inki Dae X-Patchwork-Id: 2060471 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id 3AC803FCD5 for ; Tue, 29 Jan 2013 08:57:21 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2F579E6739 for ; Tue, 29 Jan 2013 00:57:21 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout2.samsung.com (mailout2.samsung.com [203.254.224.25]) by gabe.freedesktop.org (Postfix) with ESMTP id 21F9BE61B3 for ; Tue, 29 Jan 2013 00:57:06 -0800 (PST) Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MHD00JFLQ5IGQX0@mailout2.samsung.com> for dri-devel@lists.freedesktop.org; Tue, 29 Jan 2013 17:57:04 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [203.254.230.42]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id C2.50.03880.0EE87015; Tue, 29 Jan 2013 17:57:04 +0900 (KST) X-AuditID: cbfee61b-b7fb06d000000f28-02-51078ee082ca Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 72.50.03880.0EE87015; Tue, 29 Jan 2013 17:57:04 +0900 (KST) Received: from daeinki-desktop.10.32.193.11 ([10.90.8.53]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MHD00DP6Q74SA60@mmp2.samsung.com> for dri-devel@lists.freedesktop.org; Tue, 29 Jan 2013 17:57:04 +0900 (KST) From: Inki Dae To: airlied@linux.ie, dri-devel@lists.freedesktop.org Subject: [PATCH] drm/exynos: consider exception case to fb handle creation Date: Tue, 29 Jan 2013 17:57:03 +0900 Message-id: <1359449823-19469-1-git-send-email-inki.dae@samsung.com> X-Mailer: git-send-email 1.7.4.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrDLMWRmVeSWpSXmKPExsVy+t8zLd0HfeyBBtP3qVtc+fqezYHR4373 caYAxigum5TUnMyy1CJ9uwSujD9nj7AXTGKvONG+gbmBsZmti5GTQ0LAROLp9KssELaYxIV7 64HiXBxCAssYJVpeXGeGKTp16DQTRGI6o8S3RQ0sEM46JomuXd1go9gEVCUmrrgPZosImEp0 TFoKNpZZIE3i+/e97CC2sICXxJlP/8DiLED1y1fdB9vAK+AicXhJIyPENgWJBffegp0hIbCF TeLX+weMEA0CEt8mHwJq5gBKyEpsOgB1naTEwRU3WCYwCi5gZFjFKJpakFxQnJSea6RXnJhb XJqXrpecn7uJERJW0jsYVzVYHGIU4GBU4uHVmMcWKMSaWFZcmXuIUYKDWUmE17WWPVCINyWx siq1KD++qDQntfgQYzLQ8onMUqLJ+cCQzyuJNzQ2MDY0tDQ0M7U0NSBNWEmcl/HUkwAhgfTE ktTs1NSC1CKYLUwcnFINjBM1TS97fFK9t2PzVfaDs5TW7tSbZ92+3+Lwtpj/3kt5nYy+hbx9 rbS2L2bT7YoPBSnJL2RXXFKT5nWvWbjt6l7+ef9mSyuYZxS+qu3Je3jDcd8tQ7EDrzRaMvae 28NuIpNqd73VrcR9+rS729p4LDR5BBOvG0aL7Yzc5toVvc71Yej7DvOmY0osxRmJhlrMRcWJ AJEoL5ZvAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupmkeLIzCtJLcpLzFFi42I5/e+xoO6DPvZAg8sv5C2ufH3P5sDocb/7 OFMAY1QDo01GamJKapFCal5yfkpmXrqtkndwvHO8qZmBoa6hpYW5kkJeYm6qrZKLT4CuW2YO 0FglhbLEnFKgUEBicbGSvh2mCaEhbroWMI0Rur4hQXA9RgZoIGEdY8afs0fYCyaxV5xo38Dc wNjM1sXIySEhYCJx6tBpJghbTOLCvfVAcS4OIYHpjBLfFjWwQDjrmCS6dnWDdbAJqEpMXHEf zBYRMJXomLSUBcRmFkiT+P59LzuILSzgJXHm0z+wOAtQ/fJV95lBbF4BF4nDSxoZIbYpSCy4 95ZtAiP3AkaGVYyiqQXJBcVJ6blGesWJucWleel6yfm5mxjBQftMegfjqgaLQ4wCHIxKPLwa 89gChVgTy4orcw8xSnAwK4nwutayBwrxpiRWVqUW5ccXleakFh9iTAbaPpFZSjQ5HxhReSXx hsYmZkaWRmbGJubGxqQJK4nzMp56EiAkkJ5YkpqdmlqQWgSzhYmDU6qBcelTn/ir5UsFjJ0z WPn/Vpxd8XunXm1o9MGZ3CLSs8/f8y3MVfea6dJozslaJLgk51H0A4llOzgYGH30zFkiy9gP VMqmLlSLSDfnCHv9ckfLkSPa1rPDw85dc1tn93RRlvZ8qay/bPG1M4LZPJpeX5w7T3WSWa2f whRVJgc7pfuXS9XVW34rsRRnJBpqMRcVJwIARA89op4CAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Cc: kyungmin.park@samsung.com, sw0312.kim@samsung.com 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+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org GETFB ioctl request creates a new handle to only one gem object so it should check if the given fb has one gem object. Signed-off-by: Inki Dae Signed-off-by: Kyungmin Park --- drivers/gpu/drm/exynos/exynos_drm_fb.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fb.c b/drivers/gpu/drm/exynos/exynos_drm_fb.c index 294c051..b751c8a 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fb.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fb.c @@ -99,6 +99,10 @@ static int exynos_drm_fb_create_handle(struct drm_framebuffer *fb, DRM_DEBUG_KMS("%s\n", __FILE__); + /* This fb should have only one gem object. */ + if (WARN_ON(exynos_fb->buf_cnt != 1)) + return -EINVAL; + return drm_gem_handle_create(file_priv, &exynos_fb->exynos_gem_obj[0]->base, handle); }