From patchwork Mon Jan 16 18:51:18 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Clark X-Patchwork-Id: 6242 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id AAB2923F82 for ; Mon, 16 Jan 2012 18:53:24 +0000 (UTC) Received: from mail-bk0-f52.google.com (mail-bk0-f52.google.com [209.85.214.52]) by fiordland.canonical.com (Postfix) with ESMTP id 98E32A1844C for ; Mon, 16 Jan 2012 18:53:24 +0000 (UTC) Received: by mail-bk0-f52.google.com with SMTP id zt4so869269bkb.11 for ; Mon, 16 Jan 2012 10:53:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf :dkim-signature:sender:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=lDoQyH/48fYOVv0TEFQdfMkjemKA+1e//jlNH2dia/g=; b=YlUfPTsb/Bxl33TegOdPGb0xeRFAoSxhqi6CQMaRCg1yiajK+9JpoxeNM7fBbhmwz4 L0Ct10tqTOCektoRDuPKiUXlyU2Y0IdlgVAtbY5CkhDaZcK++RLcClA7mSGgmUVA/AdA ook258Ix6Y6dN8mMS41ElIxmPWPyxupepAxkk= Received: by 10.204.41.143 with SMTP id o15mr5487327bke.63.1326740004447; Mon, 16 Jan 2012 10:53:24 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.205.82.144 with SMTP id ac16cs97905bkc; Mon, 16 Jan 2012 10:53:24 -0800 (PST) Received: by 10.236.75.163 with SMTP id z23mr18370078yhd.79.1326740002335; Mon, 16 Jan 2012 10:53:22 -0800 (PST) Received: from mail-gy0-f178.google.com (mail-gy0-f178.google.com [209.85.160.178]) by mx.google.com with ESMTPS id v6si20819347yhk.111.2012.01.16.10.53.21 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 16 Jan 2012 10:53:22 -0800 (PST) Received-SPF: pass (google.com: domain of robdclark@gmail.com designates 209.85.160.178 as permitted sender) client-ip=209.85.160.178; Authentication-Results: mx.google.com; spf=pass (google.com: domain of robdclark@gmail.com designates 209.85.160.178 as permitted sender) smtp.mail=robdclark@gmail.com; dkim=pass header.i=@gmail.com Received: by ghbg21 with SMTP id g21so47386ghb.37 for ; Mon, 16 Jan 2012 10:53:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=lDoQyH/48fYOVv0TEFQdfMkjemKA+1e//jlNH2dia/g=; b=FSu2AKvXvgOR8WVaiL4tWjnKHJ65yFIGFmJTSyYyhtVuOauoSvn+5so2QCmH9AwuAX C3rF4+QSctGOFPjLZ+HvfKPlPbm684XX3p4Okkj5W4LcU34ImeXyxnhyM7XAt8GgeD3R /TZfbQpBnLha44+u3xo7urT+6PP4hueyQBseo= Received: by 10.236.116.129 with SMTP id g1mr18066603yhh.107.1326740001701; Mon, 16 Jan 2012 10:53:21 -0800 (PST) Received: from localhost (ppp-70-129-131-203.dsl.rcsntx.swbell.net. [70.129.131.203]) by mx.google.com with ESMTPS id q40sm52260755anh.18.2012.01.16.10.53.19 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 16 Jan 2012 10:53:21 -0800 (PST) Sender: Rob Clark From: Rob Clark To: dri-devel@lists.freedesktop.org Cc: patches@linaro.org, Greg KH , Tomi Valkeinen , Andy Gross , Rob Clark Subject: [PATCH 5/5] drm/omap: updates for DSS fifomerge API changes Date: Mon, 16 Jan 2012 12:51:18 -0600 Message-Id: <1326739878-345-6-git-send-email-rob.clark@linaro.org> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1326739878-345-1-git-send-email-rob.clark@linaro.org> References: <1326739878-345-1-git-send-email-rob.clark@linaro.org> From: Rob Clark Signed-off-by: Rob Clark --- drivers/staging/omapdrm/omap_crtc.c | 2 +- drivers/staging/omapdrm/omap_drv.h | 6 ++++++ drivers/staging/omapdrm/omap_plane.c | 33 ++++++++++++++++++++++++--------- 3 files changed, 31 insertions(+), 10 deletions(-) diff --git a/drivers/staging/omapdrm/omap_crtc.c b/drivers/staging/omapdrm/omap_crtc.c index 3cee04e..17ca163 100644 --- a/drivers/staging/omapdrm/omap_crtc.c +++ b/drivers/staging/omapdrm/omap_crtc.c @@ -81,7 +81,7 @@ static int omap_crtc_mode_set(struct drm_crtc *crtc, struct omap_crtc *omap_crtc = to_omap_crtc(crtc); struct drm_plane *plane = omap_crtc->plane; - return plane->funcs->update_plane(plane, crtc, crtc->fb, + return omap_plane_mode_set(plane, crtc, crtc->fb, 0, 0, mode->hdisplay, mode->vdisplay, x << 16, y << 16, mode->hdisplay << 16, mode->vdisplay << 16); diff --git a/drivers/staging/omapdrm/omap_drv.h b/drivers/staging/omapdrm/omap_drv.h index 48f6fce..61fe022 100644 --- a/drivers/staging/omapdrm/omap_drv.h +++ b/drivers/staging/omapdrm/omap_drv.h @@ -69,6 +69,12 @@ struct drm_plane *omap_plane_init(struct drm_device *dev, struct omap_overlay *ovl, unsigned int possible_crtcs, bool priv); int omap_plane_dpms(struct drm_plane *plane, int mode); +int omap_plane_mode_set(struct drm_plane *plane, + struct drm_crtc *crtc, struct drm_framebuffer *fb, + int crtc_x, int crtc_y, + unsigned int crtc_w, unsigned int crtc_h, + uint32_t src_x, uint32_t src_y, + uint32_t src_w, uint32_t src_h); struct drm_encoder *omap_encoder_init(struct drm_device *dev, struct omap_overlay_manager *mgr); diff --git a/drivers/staging/omapdrm/omap_plane.c b/drivers/staging/omapdrm/omap_plane.c index 66eed75..9790912 100644 --- a/drivers/staging/omapdrm/omap_plane.c +++ b/drivers/staging/omapdrm/omap_plane.c @@ -85,7 +85,7 @@ static int commit(struct drm_plane *plane) } } - if (info->enabled) { + if (ovl->is_enabled(ovl)) { omap_framebuffer_flush(plane->fb, info->pos_x, info->pos_y, info->out_width, info->out_height); } @@ -115,7 +115,7 @@ static void update_manager(struct drm_plane *plane) } if (ovl->manager != mgr) { - bool enabled = omap_plane->info.enabled; + bool enabled = ovl->is_enabled(ovl); /* don't switch things around with enabled overlays: */ if (enabled) @@ -168,7 +168,8 @@ static void update_scanout(struct drm_plane *plane) if (ret) { dev_err(plane->dev->dev, "could not pin fb: %d\n", ret); - omap_plane->info.enabled = false; + omap_plane_dpms(plane, DRM_MODE_DPMS_OFF); + return; } omap_framebuffer_update_scanout(plane->fb, @@ -180,7 +181,7 @@ static void update_scanout(struct drm_plane *plane) info->screen_width); } -static int omap_plane_update(struct drm_plane *plane, +int omap_plane_mode_set(struct drm_plane *plane, struct drm_crtc *crtc, struct drm_framebuffer *fb, int crtc_x, int crtc_y, unsigned int crtc_w, unsigned int crtc_h, @@ -195,7 +196,6 @@ static int omap_plane_update(struct drm_plane *plane, src_w = src_w >> 16; src_h = src_h >> 16; - omap_plane->info.enabled = true; omap_plane->info.pos_x = crtc_x; omap_plane->info.pos_y = crtc_y; omap_plane->info.out_width = crtc_w; @@ -214,11 +214,22 @@ static int omap_plane_update(struct drm_plane *plane, update_scanout(plane); update_manager(plane); - commit(plane); return 0; } +static int omap_plane_update(struct drm_plane *plane, + struct drm_crtc *crtc, struct drm_framebuffer *fb, + int crtc_x, int crtc_y, + unsigned int crtc_w, unsigned int crtc_h, + uint32_t src_x, uint32_t src_y, + uint32_t src_w, uint32_t src_h) +{ + omap_plane_mode_set(plane, crtc, fb, crtc_x, crtc_y, crtc_w, crtc_h, + src_x, src_y, src_w, src_h); + return omap_plane_dpms(plane, DRM_MODE_DPMS_ON); +} + static int omap_plane_disable(struct drm_plane *plane) { return omap_plane_dpms(plane, DRM_MODE_DPMS_OFF); @@ -236,18 +247,22 @@ static void omap_plane_destroy(struct drm_plane *plane) int omap_plane_dpms(struct drm_plane *plane, int mode) { struct omap_plane *omap_plane = to_omap_plane(plane); + struct omap_overlay *ovl = omap_plane->ovl; + int r; DBG("%s: %d", omap_plane->ovl->name, mode); if (mode == DRM_MODE_DPMS_ON) { update_scanout(plane); - omap_plane->info.enabled = true; + r = commit(plane); + if (!r) + r = ovl->enable(ovl); } else { - omap_plane->info.enabled = false; + r = ovl->disable(ovl); update_pin(plane, NULL); } - return commit(plane); + return r; } static const struct drm_plane_funcs omap_plane_funcs = {