From patchwork Wed Oct 24 09:29:10 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 1636721 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 38AE640135 for ; Wed, 24 Oct 2012 09:30:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934542Ab2JXJ34 (ORCPT ); Wed, 24 Oct 2012 05:29:56 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:35492 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934527Ab2JXJ3y (ORCPT ); Wed, 24 Oct 2012 05:29:54 -0400 Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id q9O9TsXM012521; Wed, 24 Oct 2012 04:29:54 -0500 Received: from DLEE74.ent.ti.com (dlee74.ent.ti.com [157.170.170.8]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id q9O9TstI019023; Wed, 24 Oct 2012 04:29:54 -0500 Received: from dlelxv22.itg.ti.com (172.17.1.197) by DLEE74.ent.ti.com (157.170.170.8) with Microsoft SMTP Server id 14.1.323.3; Wed, 24 Oct 2012 04:29:53 -0500 Received: from deskari.tieu.ti.com (h64-3.vpn.ti.com [172.24.64.3]) by dlelxv22.itg.ti.com (8.13.8/8.13.8) with ESMTP id q9O9TOBT028560; Wed, 24 Oct 2012 04:29:53 -0500 From: Tomi Valkeinen To: , , CC: Tomi Valkeinen Subject: [PATCH 19/20] OMAPDSS: DISPC: remove dssdev depependency from error handler Date: Wed, 24 Oct 2012 12:29:10 +0300 Message-ID: <1351070951-18616-20-git-send-email-tomi.valkeinen@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1351070951-18616-1-git-send-email-tomi.valkeinen@ti.com> References: <1351070951-18616-1-git-send-email-tomi.valkeinen@ti.com> MIME-Version: 1.0 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org The dispc error handler tries to "fix" issues by disabling and enabling panel. This is problematic, as we're trying to remove the dependency from omapdss to the omap_dss_devices. It's also racy, and doesn't really fix anything. This patch removes the use of omap_dss_device from the error handler, and just disables and enables the associated overlay manager. This should produce similar results as the previous solution, without using dssdev. However, the error handling is still horrible. But the problem boils down to one question, to which I don't have a clear answer: what to do when a HW error happens? Signed-off-by: Tomi Valkeinen --- drivers/video/omap2/dss/dispc.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c index 070ce30..61b48ca 100644 --- a/drivers/video/omap2/dss/dispc.c +++ b/drivers/video/omap2/dss/dispc.c @@ -3902,15 +3902,12 @@ static void dispc_error_worker(struct work_struct *work) if (bit & errors) { int j; - struct omap_dss_device *dssdev = mgr->get_device(mgr); - bool enable; DSSERR("SYNC_LOST on channel %s, restarting the output " "with video overlays disabled\n", mgr->name); - enable = dssdev->state == OMAP_DSS_DISPLAY_ACTIVE; - dssdev->driver->disable(dssdev); + dss_mgr_disable(mgr); for (j = 0; j < omap_dss_get_num_overlays(); ++j) { struct omap_overlay *ovl; @@ -3918,14 +3915,10 @@ static void dispc_error_worker(struct work_struct *work) if (ovl->id != OMAP_DSS_GFX && ovl->manager == mgr) - dispc_ovl_enable(ovl->id, false); + dss_ovl_disable(ovl); } - dispc_mgr_go(mgr->id); - msleep(50); - - if (enable) - dssdev->driver->enable(dssdev); + dss_mgr_enable(mgr); } } @@ -3933,13 +3926,9 @@ static void dispc_error_worker(struct work_struct *work) DSSERR("OCP_ERR\n"); for (i = 0; i < omap_dss_get_num_overlay_managers(); ++i) { struct omap_overlay_manager *mgr; - struct omap_dss_device *dssdev; mgr = omap_dss_get_overlay_manager(i); - dssdev = mgr->get_device(mgr); - - if (dssdev && dssdev->driver) - dssdev->driver->disable(dssdev); + dss_mgr_disable(mgr); } }