From patchwork Tue Jun 5 13:54:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 137749 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp990829lji; Tue, 5 Jun 2018 06:55:02 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKdTwECvkf+OUm6j/Aa90C3lB1jm3lsMuyWhAyTYA1WxqBZl+l5iszwrN2UrhB4t+GcQ2XM X-Received: by 2002:a62:1fd6:: with SMTP id l83-v6mr26112493pfj.182.1528206902691; Tue, 05 Jun 2018 06:55:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528206902; cv=none; d=google.com; s=arc-20160816; b=HIWZJjkkSMbSa3v5FiQhtucNqn7zipj5QbIPkWWiKLvQIsjNZwH/pY/YRg7jz9tkYj mjA4+jx9jjS6XvYDv2N8S4zDdGynwkpNa4qxPbkc3/sMX8EbYe6ByrcEdfbANt9KBOdr c3G1isRyWIKa3/a+omeyzsiPULnrqL7njwzgwFNMHn+3Ol6wphZtpum6L4JSfCw1ez6V Wnj5ixeZA6QMs4jq+C7yeKn64koU9A2zjCpaWrQnWIFXHv2WtU+lK5t7UucR1yJrpgCF s8X1xcUwQ6P9qE2+EfmhfHuaEhiBromK+rj0aqXb460pJpm2nTmmxX68qLLZfkt/Up4M L7kQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:references:in-reply-to:message-id:date:subject :to:from:delivered-to:arc-authentication-results; bh=0fH08GgQ7s30WkXdS/pIXwjWPog9ZEi7O2eW3zPBg2o=; b=T8W8zWMXMvIoHBMnOAE3dj8Ji8S5SOd5QJbN6otr/9amHb+Ur6JI5kk6Bgfo5UYjSn xZgo8JyQ69m7uKM1N6GqpBMQl2W6QYVWYpsiFEW/hDXqfvuLUelaW84vJypLpWnOow/r TpgEQagMdFUVIkKvJD2n/GB0/RVaDSJ+60wqo24AdSJlBVEwKpDgWCpy638T0uXBtKkO WNMSHBpBTwVnoV7fpeapA671Ine5zkWWHRoeKjttJ7TBI1SsMh0/nMOV4Gw0AKJr6Eux 8WkWAfReztHduSMNX0jEuYT8f8346vEJQUjP1mnJ3mC9TUpjEZ7gdzUIVKJ2tw2Ais4P RaiQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id o9-v6si47985393plk.434.2018.06.05.06.55.02 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Jun 2018 06:55:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C596C6EDCC; Tue, 5 Jun 2018 13:54:29 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-x242.google.com (mail-wm0-x242.google.com [IPv6:2a00:1450:400c:c09::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1BC516EDCB for ; Tue, 5 Jun 2018 13:54:28 +0000 (UTC) Received: by mail-wm0-x242.google.com with SMTP id x6-v6so5111203wmc.3 for ; Tue, 05 Jun 2018 06:54:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=K1oT/FcwQSxjoxjOL0mWMT8CPpev4S4SgulXlwz2wXU=; b=H03ERhkiDQwxTeJ7gMr4XgBUO4UhvlA+K92QqO1X+p6Xm+P9pvDLAbdx1PHtVZDO1n Ny3zCcbFyia+eIhT1hs63MU0juwbmByhUY02PXcvubEbXTrA1yCpWD+d3z4a8y7jNANd cbCKxcJH/lx14v4J/bbhCQWiEhLFgTId2TaWno/0VIkfHSt5vAaXr0qDsgq1dIwzw8mQ eVhBWvzynlCfdVo7Yfd+1A49IRvzjf3gN3u72+7Qh3DboqCFZT94ViyQpx+pKyrsXZrp 1+LLJeYTkie7Ry/uyBI8TNxwGuB0FiuGUecHu1xkMZc6xQWFLDmpikSXFkKyBnG8J2x1 2EOQ== X-Gm-Message-State: ALKqPwdrFI8xjGUT3sccndfVexd4750pBM0osWG323bgc5mm6kYXQSAq ZwM4MliQ0hmRG/3jRhNgDELT5Q== X-Received: by 2002:a1c:b70b:: with SMTP id h11-v6mr11944028wmf.1.1528206866303; Tue, 05 Jun 2018 06:54:26 -0700 (PDT) Received: from lmecxl0911.lme.st.com (bol62-h02-176-179-166-238.dsl.sta.abo.bbox.fr. [176.179.166.238]) by smtp.gmail.com with ESMTPSA id o53-v6sm76797785wrc.96.2018.06.05.06.54.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 05 Jun 2018 06:54:25 -0700 (PDT) From: Benjamin Gaignard To: gustavo@padovan.org, maarten.lankhorst@linux.intel.com, seanpaul@chromium.org, airlied@linux.ie, vincent.abriou@st.com Subject: [PATCH v1 3/7] drm: sti: make planes use atomic_print_state instead of debugfs Date: Tue, 5 Jun 2018 15:54:03 +0200 Message-Id: <20180605135407.20214-4-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20180605135407.20214-1-benjamin.gaignard@linaro.org> References: <20180605135407.20214-1-benjamin.gaignard@linaro.org> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Convert all sti planes to atomic_print_state usage rather than use a debugfs entry. Signed-off-by: Benjamin Gaignard --- drivers/gpu/drm/sti/sti_cursor.c | 65 +++++-------- drivers/gpu/drm/sti/sti_gdp.c | 196 +++++++++++++-------------------------- drivers/gpu/drm/sti/sti_hqvdp.c | 149 +++++++++++++---------------- 3 files changed, 146 insertions(+), 264 deletions(-) diff --git a/drivers/gpu/drm/sti/sti_cursor.c b/drivers/gpu/drm/sti/sti_cursor.c index df0a282b9615..69f6b1091422 100644 --- a/drivers/gpu/drm/sti/sti_cursor.c +++ b/drivers/gpu/drm/sti/sti_cursor.c @@ -74,72 +74,57 @@ static const uint32_t cursor_supported_formats[] = { #define to_sti_cursor(x) container_of(x, struct sti_cursor, plane) -#define DBGFS_DUMP(reg) seq_printf(s, "\n %-25s 0x%08X", #reg, \ +#define DBGFS_DUMP(reg) drm_printf(p, "\n\t\t%-25s 0x%08X", #reg, \ readl(cursor->regs + reg)) -static void cursor_dbg_vpo(struct seq_file *s, u32 val) +static void cursor_dbg_vpo(struct drm_printer *p, u32 val) { - seq_printf(s, "\txdo:%4d\tydo:%4d", val & 0x0FFF, (val >> 16) & 0x0FFF); + drm_printf(p, "\txdo:%4d\tydo:%4d", val & 0x0FFF, (val >> 16) & 0x0FFF); } -static void cursor_dbg_size(struct seq_file *s, u32 val) +static void cursor_dbg_size(struct drm_printer *p, u32 val) { - seq_printf(s, "\t%d x %d", val & 0x07FF, (val >> 16) & 0x07FF); + drm_printf(p, "\t%d x %d", val & 0x07FF, (val >> 16) & 0x07FF); } -static void cursor_dbg_pml(struct seq_file *s, +static void cursor_dbg_pml(struct drm_printer *p, struct sti_cursor *cursor, u32 val) { if (cursor->pixmap.paddr == val) - seq_printf(s, "\tVirt @: %p", cursor->pixmap.base); + drm_printf(p, "\tVirt @: %pK", cursor->pixmap.base); } -static void cursor_dbg_cml(struct seq_file *s, +static void cursor_dbg_cml(struct drm_printer *p, struct sti_cursor *cursor, u32 val) { if (cursor->clut_paddr == val) - seq_printf(s, "\tVirt @: %p", cursor->clut); + drm_printf(p, "\tVirt @: %pK", cursor->clut); } -static int cursor_dbg_show(struct seq_file *s, void *data) +static void sti_cursor_plane_print_state(struct drm_printer *p, + const struct drm_plane_state *state) { - struct drm_info_node *node = s->private; - struct sti_cursor *cursor = (struct sti_cursor *)node->info_ent->data; + struct sti_plane *plane = to_sti_plane(state->plane); + struct sti_cursor *cursor = to_sti_cursor(plane); - seq_printf(s, "%s: (vaddr = 0x%p)", + drm_printf(p, "\t%s: (vaddr = 0x%pK)", sti_plane_to_str(&cursor->plane), cursor->regs); DBGFS_DUMP(CUR_CTL); DBGFS_DUMP(CUR_VPO); - cursor_dbg_vpo(s, readl(cursor->regs + CUR_VPO)); + cursor_dbg_vpo(p, readl(cursor->regs + CUR_VPO)); DBGFS_DUMP(CUR_PML); - cursor_dbg_pml(s, cursor, readl(cursor->regs + CUR_PML)); + cursor_dbg_pml(p, cursor, readl(cursor->regs + CUR_PML)); DBGFS_DUMP(CUR_PMP); DBGFS_DUMP(CUR_SIZE); - cursor_dbg_size(s, readl(cursor->regs + CUR_SIZE)); + cursor_dbg_size(p, readl(cursor->regs + CUR_SIZE)); DBGFS_DUMP(CUR_CML); - cursor_dbg_cml(s, cursor, readl(cursor->regs + CUR_CML)); + cursor_dbg_cml(p, cursor, readl(cursor->regs + CUR_CML)); DBGFS_DUMP(CUR_AWS); DBGFS_DUMP(CUR_AWE); - seq_putc(s, '\n'); - return 0; -} - -static struct drm_info_list cursor_debugfs_files[] = { - { "cursor", cursor_dbg_show, 0, NULL }, -}; - -static int cursor_debugfs_init(struct sti_cursor *cursor, - struct drm_minor *minor) -{ - unsigned int i; - for (i = 0; i < ARRAY_SIZE(cursor_debugfs_files); i++) - cursor_debugfs_files[i].data = cursor; - - return drm_debugfs_create_files(cursor_debugfs_files, - ARRAY_SIZE(cursor_debugfs_files), - minor->debugfs_root, minor); + drm_printf(p, "\t%s%s\n", + plane->fps_info.fps_str, plane->fps_info.fips_str); } static void sti_cursor_argb8888_to_clut8(struct sti_cursor *cursor, u32 *src) @@ -336,14 +321,6 @@ static void sti_cursor_destroy(struct drm_plane *drm_plane) drm_plane_cleanup(drm_plane); } -static int sti_cursor_late_register(struct drm_plane *drm_plane) -{ - struct sti_plane *plane = to_sti_plane(drm_plane); - struct sti_cursor *cursor = to_sti_cursor(plane); - - return cursor_debugfs_init(cursor, drm_plane->dev->primary); -} - static const struct drm_plane_funcs sti_cursor_plane_helpers_funcs = { .update_plane = drm_atomic_helper_update_plane, .disable_plane = drm_atomic_helper_disable_plane, @@ -351,7 +328,7 @@ static const struct drm_plane_funcs sti_cursor_plane_helpers_funcs = { .reset = sti_plane_reset, .atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state, .atomic_destroy_state = drm_atomic_helper_plane_destroy_state, - .late_register = sti_cursor_late_register, + .atomic_print_state = sti_cursor_plane_print_state, }; struct drm_plane *sti_cursor_create(struct drm_device *drm_dev, diff --git a/drivers/gpu/drm/sti/sti_gdp.c b/drivers/gpu/drm/sti/sti_gdp.c index 49813d34bdf0..55789bae72c1 100644 --- a/drivers/gpu/drm/sti/sti_gdp.c +++ b/drivers/gpu/drm/sti/sti_gdp.c @@ -139,42 +139,42 @@ static const uint32_t gdp_supported_formats[] = { DRM_FORMAT_RGB888, }; -#define DBGFS_DUMP(reg) seq_printf(s, "\n %-25s 0x%08X", #reg, \ +#define DBGFS_DUMP(reg) drm_printf(p, "\n\t\t%-25s 0x%08X", #reg, \ readl(gdp->regs + reg ## _OFFSET)) -static void gdp_dbg_ctl(struct seq_file *s, int val) +static void gdp_dbg_ctl(struct drm_printer *p, int val) { int i; - seq_puts(s, "\tColor:"); + drm_printf(p, "\tColor:"); for (i = 0; i < ARRAY_SIZE(gdp_format_to_str); i++) { if (gdp_format_to_str[i].format == (val & 0x1F)) { - seq_puts(s, gdp_format_to_str[i].name); + drm_printf(p, gdp_format_to_str[i].name); break; } } if (i == ARRAY_SIZE(gdp_format_to_str)) - seq_puts(s, ""); + drm_printf(p, ""); - seq_printf(s, "\tWaitNextVsync:%d", val & WAIT_NEXT_VSYNC ? 1 : 0); + drm_printf(p, "\tWaitNextVsync:%d", val & WAIT_NEXT_VSYNC ? 1 : 0); } -static void gdp_dbg_vpo(struct seq_file *s, int val) +static void gdp_dbg_vpo(struct drm_printer *p, int val) { - seq_printf(s, "\txdo:%4d\tydo:%4d", val & 0xFFFF, (val >> 16) & 0xFFFF); + drm_printf(p, "\txdo:%4d\tydo:%4d", val & 0xFFFF, (val >> 16) & 0xFFFF); } -static void gdp_dbg_vps(struct seq_file *s, int val) +static void gdp_dbg_vps(struct drm_printer *p, int val) { - seq_printf(s, "\txds:%4d\tyds:%4d", val & 0xFFFF, (val >> 16) & 0xFFFF); + drm_printf(p, "\txds:%4d\tyds:%4d", val & 0xFFFF, (val >> 16) & 0xFFFF); } -static void gdp_dbg_size(struct seq_file *s, int val) +static void gdp_dbg_size(struct drm_printer *p, int val) { - seq_printf(s, "\t%d x %d", val & 0xFFFF, (val >> 16) & 0xFFFF); + drm_printf(p, "\t%d x %d", val & 0xFFFF, (val >> 16) & 0xFFFF); } -static void gdp_dbg_nvn(struct seq_file *s, struct sti_gdp *gdp, int val) +static void gdp_dbg_nvn(struct drm_printer *p, struct sti_gdp *gdp, int val) { void *base = NULL; unsigned int i; @@ -191,157 +191,93 @@ static void gdp_dbg_nvn(struct seq_file *s, struct sti_gdp *gdp, int val) } if (base) - seq_printf(s, "\tVirt @: %p", base); + drm_printf(p, "\tVirt @: %pK", base); } -static void gdp_dbg_ppt(struct seq_file *s, int val) +static void gdp_dbg_ppt(struct drm_printer *p, int val) { if (val & GAM_GDP_PPT_IGNORE) - seq_puts(s, "\tNot displayed on mixer!"); + drm_printf(p, "\tNot displayed on mixer!"); } -static void gdp_dbg_mst(struct seq_file *s, int val) +static void gdp_dbg_mst(struct drm_printer *p, int val) { if (val & 1) - seq_puts(s, "\tBUFFER UNDERFLOW!"); + drm_printf(p, "\tBUFFER UNDERFLOW!"); } -static int gdp_dbg_show(struct seq_file *s, void *data) +static int gdp_dbg_show(struct drm_printer *p, struct sti_gdp *gdp) { - struct drm_info_node *node = s->private; - struct sti_gdp *gdp = (struct sti_gdp *)node->info_ent->data; - struct drm_plane *drm_plane = &gdp->plane.drm_plane; - struct drm_crtc *crtc; - - drm_modeset_lock(&drm_plane->mutex, NULL); - crtc = drm_plane->state->crtc; - drm_modeset_unlock(&drm_plane->mutex); - - seq_printf(s, "%s: (vaddr = 0x%p)", + drm_printf(p, "\t%s: (vaddr = 0x%pK)", sti_plane_to_str(&gdp->plane), gdp->regs); DBGFS_DUMP(GAM_GDP_CTL); - gdp_dbg_ctl(s, readl(gdp->regs + GAM_GDP_CTL_OFFSET)); + gdp_dbg_ctl(p, readl(gdp->regs + GAM_GDP_CTL_OFFSET)); DBGFS_DUMP(GAM_GDP_AGC); DBGFS_DUMP(GAM_GDP_VPO); - gdp_dbg_vpo(s, readl(gdp->regs + GAM_GDP_VPO_OFFSET)); + gdp_dbg_vpo(p, readl(gdp->regs + GAM_GDP_VPO_OFFSET)); DBGFS_DUMP(GAM_GDP_VPS); - gdp_dbg_vps(s, readl(gdp->regs + GAM_GDP_VPS_OFFSET)); + gdp_dbg_vps(p, readl(gdp->regs + GAM_GDP_VPS_OFFSET)); DBGFS_DUMP(GAM_GDP_PML); DBGFS_DUMP(GAM_GDP_PMP); DBGFS_DUMP(GAM_GDP_SIZE); - gdp_dbg_size(s, readl(gdp->regs + GAM_GDP_SIZE_OFFSET)); + gdp_dbg_size(p, readl(gdp->regs + GAM_GDP_SIZE_OFFSET)); DBGFS_DUMP(GAM_GDP_NVN); - gdp_dbg_nvn(s, gdp, readl(gdp->regs + GAM_GDP_NVN_OFFSET)); + gdp_dbg_nvn(p, gdp, readl(gdp->regs + GAM_GDP_NVN_OFFSET)); DBGFS_DUMP(GAM_GDP_KEY1); DBGFS_DUMP(GAM_GDP_KEY2); DBGFS_DUMP(GAM_GDP_PPT); - gdp_dbg_ppt(s, readl(gdp->regs + GAM_GDP_PPT_OFFSET)); + gdp_dbg_ppt(p, readl(gdp->regs + GAM_GDP_PPT_OFFSET)); DBGFS_DUMP(GAM_GDP_CML); DBGFS_DUMP(GAM_GDP_MST); - gdp_dbg_mst(s, readl(gdp->regs + GAM_GDP_MST_OFFSET)); - - seq_puts(s, "\n\n"); - if (!crtc) - seq_puts(s, " Not connected to any DRM CRTC\n"); - else - seq_printf(s, " Connected to DRM CRTC #%d (%s)\n", - crtc->base.id, sti_mixer_to_str(to_sti_mixer(crtc))); + gdp_dbg_mst(p, readl(gdp->regs + GAM_GDP_MST_OFFSET)); + drm_printf(p, "\n"); return 0; } -static void gdp_node_dump_node(struct seq_file *s, struct sti_gdp_node *node) +static void gdp_node_dump_node(struct drm_printer *p, struct sti_gdp_node *node) { - seq_printf(s, "\t@:0x%p", node); - seq_printf(s, "\n\tCTL 0x%08X", node->gam_gdp_ctl); - gdp_dbg_ctl(s, node->gam_gdp_ctl); - seq_printf(s, "\n\tAGC 0x%08X", node->gam_gdp_agc); - seq_printf(s, "\n\tVPO 0x%08X", node->gam_gdp_vpo); - gdp_dbg_vpo(s, node->gam_gdp_vpo); - seq_printf(s, "\n\tVPS 0x%08X", node->gam_gdp_vps); - gdp_dbg_vps(s, node->gam_gdp_vps); - seq_printf(s, "\n\tPML 0x%08X", node->gam_gdp_pml); - seq_printf(s, "\n\tPMP 0x%08X", node->gam_gdp_pmp); - seq_printf(s, "\n\tSIZE 0x%08X", node->gam_gdp_size); - gdp_dbg_size(s, node->gam_gdp_size); - seq_printf(s, "\n\tNVN 0x%08X", node->gam_gdp_nvn); - seq_printf(s, "\n\tKEY1 0x%08X", node->gam_gdp_key1); - seq_printf(s, "\n\tKEY2 0x%08X", node->gam_gdp_key2); - seq_printf(s, "\n\tPPT 0x%08X", node->gam_gdp_ppt); - gdp_dbg_ppt(s, node->gam_gdp_ppt); - seq_printf(s, "\n\tCML 0x%08X\n", node->gam_gdp_cml); + drm_printf(p, "\t@:0x%pK", node); + drm_printf(p, "\n\t\tCTL 0x%08X", node->gam_gdp_ctl); + gdp_dbg_ctl(p, node->gam_gdp_ctl); + drm_printf(p, "\n\t\tAGC 0x%08X", node->gam_gdp_agc); + drm_printf(p, "\n\t\tVPO 0x%08X", node->gam_gdp_vpo); + gdp_dbg_vpo(p, node->gam_gdp_vpo); + drm_printf(p, "\n\t\tVPS 0x%08X", node->gam_gdp_vps); + gdp_dbg_vps(p, node->gam_gdp_vps); + drm_printf(p, "\n\t\tPML 0x%08X", node->gam_gdp_pml); + drm_printf(p, "\n\t\tPMP 0x%08X", node->gam_gdp_pmp); + drm_printf(p, "\n\t\tSIZE 0x%08X", node->gam_gdp_size); + gdp_dbg_size(p, node->gam_gdp_size); + drm_printf(p, "\n\t\tNVN 0x%08X", node->gam_gdp_nvn); + drm_printf(p, "\n\t\tKEY1 0x%08X", node->gam_gdp_key1); + drm_printf(p, "\n\t\tKEY2 0x%08X", node->gam_gdp_key2); + drm_printf(p, "\n\t\tPPT 0x%08X", node->gam_gdp_ppt); + gdp_dbg_ppt(p, node->gam_gdp_ppt); + drm_printf(p, "\n\t\tCML 0x%08X\n", node->gam_gdp_cml); } -static int gdp_node_dbg_show(struct seq_file *s, void *arg) +static void sti_gdp_plane_print_state(struct drm_printer *p, + const struct drm_plane_state *state) { - struct drm_info_node *node = s->private; - struct sti_gdp *gdp = (struct sti_gdp *)node->info_ent->data; + struct sti_plane *plane = to_sti_plane(state->plane); + struct sti_gdp *gdp = to_sti_gdp(plane); unsigned int b; - for (b = 0; b < GDP_NODE_NB_BANK; b++) { - seq_printf(s, "\n%s[%d].top", sti_plane_to_str(&gdp->plane), b); - gdp_node_dump_node(s, gdp->node_list[b].top_field); - seq_printf(s, "\n%s[%d].btm", sti_plane_to_str(&gdp->plane), b); - gdp_node_dump_node(s, gdp->node_list[b].btm_field); - } - - return 0; -} - -static struct drm_info_list gdp0_debugfs_files[] = { - { "gdp0", gdp_dbg_show, 0, NULL }, - { "gdp0_node", gdp_node_dbg_show, 0, NULL }, -}; - -static struct drm_info_list gdp1_debugfs_files[] = { - { "gdp1", gdp_dbg_show, 0, NULL }, - { "gdp1_node", gdp_node_dbg_show, 0, NULL }, -}; - -static struct drm_info_list gdp2_debugfs_files[] = { - { "gdp2", gdp_dbg_show, 0, NULL }, - { "gdp2_node", gdp_node_dbg_show, 0, NULL }, -}; - -static struct drm_info_list gdp3_debugfs_files[] = { - { "gdp3", gdp_dbg_show, 0, NULL }, - { "gdp3_node", gdp_node_dbg_show, 0, NULL }, -}; - -static int gdp_debugfs_init(struct sti_gdp *gdp, struct drm_minor *minor) -{ - unsigned int i; - struct drm_info_list *gdp_debugfs_files; - int nb_files; + gdp_dbg_show(p, gdp); - switch (gdp->plane.desc) { - case STI_GDP_0: - gdp_debugfs_files = gdp0_debugfs_files; - nb_files = ARRAY_SIZE(gdp0_debugfs_files); - break; - case STI_GDP_1: - gdp_debugfs_files = gdp1_debugfs_files; - nb_files = ARRAY_SIZE(gdp1_debugfs_files); - break; - case STI_GDP_2: - gdp_debugfs_files = gdp2_debugfs_files; - nb_files = ARRAY_SIZE(gdp2_debugfs_files); - break; - case STI_GDP_3: - gdp_debugfs_files = gdp3_debugfs_files; - nb_files = ARRAY_SIZE(gdp3_debugfs_files); - break; - default: - return -EINVAL; + for (b = 0; b < GDP_NODE_NB_BANK; b++) { + drm_printf(p, "\t%s[%d].top\n", + sti_plane_to_str(&gdp->plane), b); + gdp_node_dump_node(p, gdp->node_list[b].top_field); + drm_printf(p, "\t%s[%d].btm\n", + sti_plane_to_str(&gdp->plane), b); + gdp_node_dump_node(p, gdp->node_list[b].btm_field); } - for (i = 0; i < nb_files; i++) - gdp_debugfs_files[i].data = gdp; - - return drm_debugfs_create_files(gdp_debugfs_files, - nb_files, - minor->debugfs_root, minor); + drm_printf(p, "\t%s%s\n", + plane->fps_info.fps_str, plane->fps_info.fips_str); } static int sti_gdp_fourcc2format(int fourcc) @@ -887,14 +823,6 @@ static void sti_gdp_destroy(struct drm_plane *drm_plane) drm_plane_cleanup(drm_plane); } -static int sti_gdp_late_register(struct drm_plane *drm_plane) -{ - struct sti_plane *plane = to_sti_plane(drm_plane); - struct sti_gdp *gdp = to_sti_gdp(plane); - - return gdp_debugfs_init(gdp, drm_plane->dev->primary); -} - static const struct drm_plane_funcs sti_gdp_plane_helpers_funcs = { .update_plane = drm_atomic_helper_update_plane, .disable_plane = drm_atomic_helper_disable_plane, @@ -902,7 +830,7 @@ static const struct drm_plane_funcs sti_gdp_plane_helpers_funcs = { .reset = sti_plane_reset, .atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state, .atomic_destroy_state = drm_atomic_helper_plane_destroy_state, - .late_register = sti_gdp_late_register, + .atomic_print_state = sti_gdp_plane_print_state, }; struct drm_plane *sti_gdp_create(struct drm_device *drm_dev, diff --git a/drivers/gpu/drm/sti/sti_hqvdp.c b/drivers/gpu/drm/sti/sti_hqvdp.c index 106be8c4e58b..f218f636966c 100644 --- a/drivers/gpu/drm/sti/sti_hqvdp.c +++ b/drivers/gpu/drm/sti/sti_hqvdp.c @@ -441,7 +441,7 @@ static int sti_hqvdp_get_next_cmd(struct sti_hqvdp *hqvdp) return -1; } -#define DBGFS_DUMP(reg) seq_printf(s, "\n %-25s 0x%08X", #reg, \ +#define DBGFS_DUMP(reg) drm_printf(p, "\n\t\t%-25s 0x%08X", #reg, \ readl(hqvdp->regs + reg)) static const char *hqvdp_dbg_get_lut(u32 *coef) @@ -469,99 +469,100 @@ static const char *hqvdp_dbg_get_lut(u32 *coef) return ""; } -static void hqvdp_dbg_dump_cmd(struct seq_file *s, struct sti_hqvdp_cmd *c) +static void hqvdp_dbg_dump_cmd(struct drm_printer *p, struct sti_hqvdp_cmd *c) { int src_w, src_h, dst_w, dst_h; - seq_puts(s, "\n\tTOP:"); - seq_printf(s, "\n\t %-20s 0x%08X", "Config", c->top.config); + drm_printf(p, "\n\tTOP:"); + drm_printf(p, "\n\t %-20s 0x%08X", "Config", c->top.config); switch (c->top.config) { case TOP_CONFIG_PROGRESSIVE: - seq_puts(s, "\tProgressive"); + drm_printf(p, "\tProgressive"); break; case TOP_CONFIG_INTER_TOP: - seq_puts(s, "\tInterlaced, top field"); + drm_printf(p, "\tInterlaced, top field"); break; case TOP_CONFIG_INTER_BTM: - seq_puts(s, "\tInterlaced, bottom field"); + drm_printf(p, "\tInterlaced, bottom field"); break; default: - seq_puts(s, "\t"); + drm_printf(p, "\t"); break; } - seq_printf(s, "\n\t %-20s 0x%08X", "MemFormat", c->top.mem_format); - seq_printf(s, "\n\t %-20s 0x%08X", "CurrentY", c->top.current_luma); - seq_printf(s, "\n\t %-20s 0x%08X", "CurrentC", c->top.current_chroma); - seq_printf(s, "\n\t %-20s 0x%08X", "YSrcPitch", c->top.luma_src_pitch); - seq_printf(s, "\n\t %-20s 0x%08X", "CSrcPitch", + drm_printf(p, "\n\t %-20s 0x%08X", "MemFormat", c->top.mem_format); + drm_printf(p, "\n\t %-20s 0x%08X", "CurrentY", c->top.current_luma); + drm_printf(p, "\n\t %-20s 0x%08X", "CurrentC", c->top.current_chroma); + drm_printf(p, "\n\t %-20s 0x%08X", "YSrcPitch", c->top.luma_src_pitch); + drm_printf(p, "\n\t %-20s 0x%08X", "CSrcPitch", c->top.chroma_src_pitch); - seq_printf(s, "\n\t %-20s 0x%08X", "InputFrameSize", + drm_printf(p, "\n\t %-20s 0x%08X", "InputFrameSize", c->top.input_frame_size); - seq_printf(s, "\t%dx%d", + drm_printf(p, "\t%dx%d", c->top.input_frame_size & 0x0000FFFF, c->top.input_frame_size >> 16); - seq_printf(s, "\n\t %-20s 0x%08X", "InputViewportSize", + drm_printf(p, "\n\t %-20s 0x%08X", "InputViewportSize", c->top.input_viewport_size); src_w = c->top.input_viewport_size & 0x0000FFFF; src_h = c->top.input_viewport_size >> 16; - seq_printf(s, "\t%dx%d", src_w, src_h); + drm_printf(p, "\t%dx%d", src_w, src_h); - seq_puts(s, "\n\tHVSRC:"); - seq_printf(s, "\n\t %-20s 0x%08X", "OutputPictureSize", + drm_printf(p, "\n\tHVSRC:"); + drm_printf(p, "\n\t %-20s 0x%08X", "OutputPictureSize", c->hvsrc.output_picture_size); dst_w = c->hvsrc.output_picture_size & 0x0000FFFF; dst_h = c->hvsrc.output_picture_size >> 16; - seq_printf(s, "\t%dx%d", dst_w, dst_h); - seq_printf(s, "\n\t %-20s 0x%08X", "ParamCtrl", c->hvsrc.param_ctrl); + drm_printf(p, "\t%dx%d", dst_w, dst_h); + drm_printf(p, "\n\t %-20s 0x%08X", "ParamCtrl", c->hvsrc.param_ctrl); - seq_printf(s, "\n\t %-20s %s", "yh_coef", + drm_printf(p, "\n\t %-20s %s", "yh_coef", hqvdp_dbg_get_lut(c->hvsrc.yh_coef)); - seq_printf(s, "\n\t %-20s %s", "ch_coef", + drm_printf(p, "\n\t %-20s %s", "ch_coef", hqvdp_dbg_get_lut(c->hvsrc.ch_coef)); - seq_printf(s, "\n\t %-20s %s", "yv_coef", + drm_printf(p, "\n\t %-20s %s", "yv_coef", hqvdp_dbg_get_lut(c->hvsrc.yv_coef)); - seq_printf(s, "\n\t %-20s %s", "cv_coef", + drm_printf(p, "\n\t %-20s %s", "cv_coef", hqvdp_dbg_get_lut(c->hvsrc.cv_coef)); - seq_printf(s, "\n\t %-20s", "ScaleH"); + drm_printf(p, "\n\t %-20s", "ScaleH"); if (dst_w > src_w) - seq_printf(s, " %d/1", dst_w / src_w); + drm_printf(p, " %d/1", dst_w / src_w); else - seq_printf(s, " 1/%d", src_w / dst_w); + drm_printf(p, " 1/%d", src_w / dst_w); - seq_printf(s, "\n\t %-20s", "tScaleV"); + drm_printf(p, "\n\t %-20s", "tScaleV"); if (dst_h > src_h) - seq_printf(s, " %d/1", dst_h / src_h); + drm_printf(p, " %d/1", dst_h / src_h); else - seq_printf(s, " 1/%d", src_h / dst_h); + drm_printf(p, " 1/%d", src_h / dst_h); - seq_puts(s, "\n\tCSDI:"); - seq_printf(s, "\n\t %-20s 0x%08X\t", "Config", c->csdi.config); + drm_printf(p, "\n\tCSDI:"); + drm_printf(p, "\n\t %-20s 0x%08X\t", "Config", c->csdi.config); switch (c->csdi.config) { case CSDI_CONFIG_PROG: - seq_puts(s, "Bypass"); + drm_printf(p, "Bypass"); break; case CSDI_CONFIG_INTER_DIR: - seq_puts(s, "Deinterlace, directional"); + drm_printf(p, "Deinterlace, directional"); break; default: - seq_puts(s, ""); + drm_printf(p, ""); break; } - seq_printf(s, "\n\t %-20s 0x%08X", "Config2", c->csdi.config2); - seq_printf(s, "\n\t %-20s 0x%08X", "DcdiConfig", c->csdi.dcdi_config); + drm_printf(p, "\n\t %-20s 0x%08X", "Config2", c->csdi.config2); + drm_printf(p, "\n\t %-20s 0x%08X", "DcdiConfig", c->csdi.dcdi_config); } -static int hqvdp_dbg_show(struct seq_file *s, void *data) +static void sti_hqvdp_plane_print_state(struct drm_printer *p, + const struct drm_plane_state *state) { - struct drm_info_node *node = s->private; - struct sti_hqvdp *hqvdp = (struct sti_hqvdp *)node->info_ent->data; + struct sti_plane *plane = to_sti_plane(state->plane); + struct sti_hqvdp *hqvdp = to_sti_hqvdp(plane); int cmd, cmd_offset, infoxp70; void *virt; - seq_printf(s, "%s: (vaddr = 0x%p)", + drm_printf(p, "\t%s: (vaddr = 0x%pK)", sti_plane_to_str(&hqvdp->plane), hqvdp->regs); DBGFS_DUMP(HQVDP_MBX_IRQ_TO_XP70); @@ -569,80 +570,64 @@ static int hqvdp_dbg_show(struct seq_file *s, void *data) DBGFS_DUMP(HQVDP_MBX_IRQ_TO_HOST); DBGFS_DUMP(HQVDP_MBX_INFO_XP70); infoxp70 = readl(hqvdp->regs + HQVDP_MBX_INFO_XP70); - seq_puts(s, "\tFirmware state: "); + drm_printf(p, "\tFirmware state: "); if (infoxp70 & INFO_XP70_FW_READY) - seq_puts(s, "idle and ready"); + drm_printf(p, "idle and ready"); else if (infoxp70 & INFO_XP70_FW_PROCESSING) - seq_puts(s, "processing a picture"); + drm_printf(p, "processing a picture"); else if (infoxp70 & INFO_XP70_FW_INITQUEUES) - seq_puts(s, "programming queues"); + drm_printf(p, "programming queues"); else - seq_puts(s, "NOT READY"); + drm_printf(p, "NOT READY"); DBGFS_DUMP(HQVDP_MBX_SW_RESET_CTRL); DBGFS_DUMP(HQVDP_MBX_STARTUP_CTRL1); if (readl(hqvdp->regs + HQVDP_MBX_STARTUP_CTRL1) & STARTUP_CTRL1_RST_DONE) - seq_puts(s, "\tReset is done"); + drm_printf(p, "\tReset is done"); else - seq_puts(s, "\tReset is NOT done"); + drm_printf(p, "\tReset is NOT done"); DBGFS_DUMP(HQVDP_MBX_STARTUP_CTRL2); if (readl(hqvdp->regs + HQVDP_MBX_STARTUP_CTRL2) & STARTUP_CTRL2_FETCH_EN) - seq_puts(s, "\tFetch is enabled"); + drm_printf(p, "\tFetch is enabled"); else - seq_puts(s, "\tFetch is NOT enabled"); + drm_printf(p, "\tFetch is NOT enabled"); DBGFS_DUMP(HQVDP_MBX_GP_STATUS); DBGFS_DUMP(HQVDP_MBX_NEXT_CMD); DBGFS_DUMP(HQVDP_MBX_CURRENT_CMD); DBGFS_DUMP(HQVDP_MBX_SOFT_VSYNC); if (!(readl(hqvdp->regs + HQVDP_MBX_SOFT_VSYNC) & 3)) - seq_puts(s, "\tHW Vsync"); + drm_printf(p, "\tHW Vsync"); else - seq_puts(s, "\tSW Vsync ?!?!"); + drm_printf(p, "\tSW Vsync ?!?!"); /* Last command */ cmd = readl(hqvdp->regs + HQVDP_MBX_CURRENT_CMD); cmd_offset = sti_hqvdp_get_curr_cmd(hqvdp); if (cmd_offset == -1) { - seq_puts(s, "\n\n Last command: unknown"); + drm_printf(p, "\n\n\t\tLast command: unknown"); } else { virt = hqvdp->hqvdp_cmd + cmd_offset; - seq_printf(s, "\n\n Last command: address @ 0x%x (0x%p)", + drm_printf(p, "\n\n\t\tLast command: address @ 0x%x (0x%p)", cmd, virt); - hqvdp_dbg_dump_cmd(s, (struct sti_hqvdp_cmd *)virt); + hqvdp_dbg_dump_cmd(p, (struct sti_hqvdp_cmd *)virt); } /* Next command */ cmd = readl(hqvdp->regs + HQVDP_MBX_NEXT_CMD); cmd_offset = sti_hqvdp_get_next_cmd(hqvdp); if (cmd_offset == -1) { - seq_puts(s, "\n\n Next command: unknown"); + drm_printf(p, "\n\n\t\tNext command: unknown"); } else { virt = hqvdp->hqvdp_cmd + cmd_offset; - seq_printf(s, "\n\n Next command address: @ 0x%x (0x%p)", + drm_printf(p, "\n\n\t\tNext command address: @ 0x%x (0x%p)", cmd, virt); - hqvdp_dbg_dump_cmd(s, (struct sti_hqvdp_cmd *)virt); + hqvdp_dbg_dump_cmd(p, (struct sti_hqvdp_cmd *)virt); } - seq_putc(s, '\n'); - return 0; -} - -static struct drm_info_list hqvdp_debugfs_files[] = { - { "hqvdp", hqvdp_dbg_show, 0, NULL }, -}; - -static int hqvdp_debugfs_init(struct sti_hqvdp *hqvdp, struct drm_minor *minor) -{ - unsigned int i; - - for (i = 0; i < ARRAY_SIZE(hqvdp_debugfs_files); i++) - hqvdp_debugfs_files[i].data = hqvdp; - - return drm_debugfs_create_files(hqvdp_debugfs_files, - ARRAY_SIZE(hqvdp_debugfs_files), - minor->debugfs_root, minor); + drm_printf(p, "\t%s%s\n", + plane->fps_info.fps_str, plane->fps_info.fips_str); } /** @@ -1264,14 +1249,6 @@ static void sti_hqvdp_destroy(struct drm_plane *drm_plane) drm_plane_cleanup(drm_plane); } -static int sti_hqvdp_late_register(struct drm_plane *drm_plane) -{ - struct sti_plane *plane = to_sti_plane(drm_plane); - struct sti_hqvdp *hqvdp = to_sti_hqvdp(plane); - - return hqvdp_debugfs_init(hqvdp, drm_plane->dev->primary); -} - static const struct drm_plane_funcs sti_hqvdp_plane_helpers_funcs = { .update_plane = drm_atomic_helper_update_plane, .disable_plane = drm_atomic_helper_disable_plane, @@ -1279,7 +1256,7 @@ static const struct drm_plane_funcs sti_hqvdp_plane_helpers_funcs = { .reset = sti_plane_reset, .atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state, .atomic_destroy_state = drm_atomic_helper_plane_destroy_state, - .late_register = sti_hqvdp_late_register, + .atomic_print_state = sti_hqvdp_plane_print_state, }; static struct drm_plane *sti_hqvdp_create(struct drm_device *drm_dev, From patchwork Tue Jun 5 13:54:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 137750 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp990932lji; Tue, 5 Jun 2018 06:55:07 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKyYFrRRz2qWct8luRpiJDtqy1pTehFDCfi6o+vaewzzAPXYmILJ14bVRA+JWVq/0xJvwHQ X-Received: by 2002:a17:902:7242:: with SMTP id c2-v6mr18195002pll.383.1528206907756; Tue, 05 Jun 2018 06:55:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528206907; cv=none; d=google.com; s=arc-20160816; b=pRpMYxpt4vnlTZavfJwoMNJko+4JNB/WFZUXnn8rZvsBvXjIDOBbvmWqIWo9Wm22yi SmhKupkMb/N9Ppe5uTi9V6oUMhCq9dpbYU9D4lMNbrhbQepsSc8TbuHyMFwxk0GZJ4y6 Vv0GlsGwtnMAAYaE9pX1eO8qQqwR0wOVLLkXIzqdYC9n0+ZDy6WVyAyb+qSeH1JK6a/h vOTiGvWeWqtYrfn+taLNQ64RHiDkOSdsjDP1//29BXtlRgFmoC2kcUYRE/7udxhEqVPr 5O7Byio+GuE5bH8OjSP+6pNo6M/JY3t7HA77eeTBA2oFkqtzyGj12WuxBc8yk7rf8KKS thVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:references:in-reply-to:message-id:date:subject :to:from:delivered-to:arc-authentication-results; bh=FUSIlzN+xO4DBxQqFD+tGl1aivO54D6vrletP/rfgfY=; b=fiUJsYmNmrecZtw/nQAb8oDfLiHv/lXHfRsuBbmtitQ2PDq7Xm/7kSzE2dNPoyPmRm Dkzvy7cFf0S6VVpLE76iag/5j/CvE1ueCagxffcEceLs8/p6QNGzHBW+A64kw7QIquro EOi5C7Py09/if+j2LBkM5oGLtiVMBYTRCILGX9mU/YYtEvrHIQA/ndJymFQtgeiWmrbA ugWbGHxxcfnMx1wbBt8jvMDZfciZaGlkn2sDoOkVgAIHjNAkVONDMM+OAdbDxIxLuggo +15WUdNFd1tToNB/wcOsbIwFRMUobQLgRU4tcV6fTPp2EnP4FpkOr/e6i52FX42/gaAL diBQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id x20-v6si20277062pge.395.2018.06.05.06.55.07 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Jun 2018 06:55:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 280526EDD2; Tue, 5 Jun 2018 13:54:32 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-x244.google.com (mail-wm0-x244.google.com [IPv6:2a00:1450:400c:c09::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1E54F6EDCF for ; Tue, 5 Jun 2018 13:54:30 +0000 (UTC) Received: by mail-wm0-x244.google.com with SMTP id p126-v6so5153783wmb.2 for ; Tue, 05 Jun 2018 06:54:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=IFfGjiggqQGsm6HhVKB5SmPlDErmYhspaKe+mXsnLGA=; b=VoiwQRTs4jY2rIRQ4i01u3apkZpHrwCHYiITo/Xg1iY69NNnMbrfRSJ4aLuG6NEoyo 1uHk2ZDmns68mf4lO9/2cmQWmZgs1ma8r1Ch5/616ArqJRtVN9LLVCXvmbswlVyquOJJ yDy0VcZ3i22uftfNopMbAAx8KNBm/wjyQns2Kc6EWcbr0yEgQEQfTBQuOK34H30EzWcy Om0qPteOAos8GszOpJqaNVkmTdpVQVU3rQ7ijX/mAwM6oVT6TRLLUPZu38y9xiBEtfUB RZlJPF09VQ6Ok3Xp+jHN81c3VUfvc5BttSdfwVrWtVijdnOFbkBvsJ+pgdEs5EJfGCqW rloA== X-Gm-Message-State: APt69E1McQONzCUvgZSy1IVo4bl7Cmv68vbEsTvJn9sF6S9aqRSHXXjm pf60L4LNHjqCAppJz7VOt5Vugg== X-Received: by 2002:a1c:5894:: with SMTP id m142-v6mr11778726wmb.10.1528206868465; Tue, 05 Jun 2018 06:54:28 -0700 (PDT) Received: from lmecxl0911.lme.st.com (bol62-h02-176-179-166-238.dsl.sta.abo.bbox.fr. [176.179.166.238]) by smtp.gmail.com with ESMTPSA id o53-v6sm76797785wrc.96.2018.06.05.06.54.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 05 Jun 2018 06:54:27 -0700 (PDT) From: Benjamin Gaignard To: gustavo@padovan.org, maarten.lankhorst@linux.intel.com, seanpaul@chromium.org, airlied@linux.ie, vincent.abriou@st.com Subject: [PATCH v1 4/7] drm: sti: make connectors use atomic_print_state instead of debugfs Date: Tue, 5 Jun 2018 15:54:04 +0200 Message-Id: <20180605135407.20214-5-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20180605135407.20214-1-benjamin.gaignard@linaro.org> References: <20180605135407.20214-1-benjamin.gaignard@linaro.org> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Convert all sti connectors to atomic_print_state usage rather than use a debugfs entry. Signed-off-by: Benjamin Gaignard Reviewed-by: Philippe Cornu --- drivers/gpu/drm/sti/sti_dvo.c | 60 +++++-------------- drivers/gpu/drm/sti/sti_hda.c | 75 +++++++---------------- drivers/gpu/drm/sti/sti_hdmi.c | 132 ++++++++++++++++------------------------- 3 files changed, 90 insertions(+), 177 deletions(-) diff --git a/drivers/gpu/drm/sti/sti_dvo.c b/drivers/gpu/drm/sti/sti_dvo.c index a5979cd25cc7..5662613ae6e0 100644 --- a/drivers/gpu/drm/sti/sti_dvo.c +++ b/drivers/gpu/drm/sti/sti_dvo.c @@ -6,7 +6,6 @@ #include #include -#include #include #include #include @@ -158,52 +157,37 @@ static void dvo_awg_configure(struct sti_dvo *dvo, u32 *awg_ram_code, int nb) writel(DVO_AWG_CTRL_EN, dvo->regs + DVO_AWG_DIGSYNC_CTRL); } -#define DBGFS_DUMP(reg) seq_printf(s, "\n %-25s 0x%08X", #reg, \ +#define DBGFS_DUMP(reg) drm_printf(p, "\n\t\t%-25s 0x%08X", #reg, \ readl(dvo->regs + reg)) -static void dvo_dbg_awg_microcode(struct seq_file *s, void __iomem *reg) +static void dvo_dbg_awg_microcode(struct drm_printer *p, void __iomem *reg) { unsigned int i; - seq_puts(s, "\n\n"); - seq_puts(s, " DVO AWG microcode:"); + drm_printf(p, "\n\n"); + drm_printf(p, " DVO AWG microcode:"); for (i = 0; i < AWG_MAX_INST; i++) { if (i % 8 == 0) - seq_printf(s, "\n %04X:", i); - seq_printf(s, " %04X", readl(reg + i * 4)); + drm_printf(p, "\n %04X:", i); + drm_printf(p, " %04X", readl(reg + i * 4)); } } -static int dvo_dbg_show(struct seq_file *s, void *data) +static void sti_dvo_print_state(struct drm_printer *p, + const struct drm_connector_state *state) { - struct drm_info_node *node = s->private; - struct sti_dvo *dvo = (struct sti_dvo *)node->info_ent->data; + struct sti_dvo_connector *dvo_connector + = to_sti_dvo_connector(state->connector); + struct sti_dvo *dvo = dvo_connector->dvo; - seq_printf(s, "DVO: (vaddr = 0x%p)", dvo->regs); + drm_printf(p, "DVO: (vaddr = 0x%p)", dvo->regs); DBGFS_DUMP(DVO_AWG_DIGSYNC_CTRL); DBGFS_DUMP(DVO_DOF_CFG); DBGFS_DUMP(DVO_LUT_PROG_LOW); DBGFS_DUMP(DVO_LUT_PROG_MID); DBGFS_DUMP(DVO_LUT_PROG_HIGH); - dvo_dbg_awg_microcode(s, dvo->regs + DVO_DIGSYNC_INSTR_I); - seq_putc(s, '\n'); - return 0; -} - -static struct drm_info_list dvo_debugfs_files[] = { - { "dvo", dvo_dbg_show, 0, NULL }, -}; - -static int dvo_debugfs_init(struct sti_dvo *dvo, struct drm_minor *minor) -{ - unsigned int i; - - for (i = 0; i < ARRAY_SIZE(dvo_debugfs_files); i++) - dvo_debugfs_files[i].data = dvo; - - return drm_debugfs_create_files(dvo_debugfs_files, - ARRAY_SIZE(dvo_debugfs_files), - minor->debugfs_root, minor); + dvo_dbg_awg_microcode(p, dvo->regs + DVO_DIGSYNC_INSTR_I); + drm_printf(p, "\n"); } static void sti_dvo_disable(struct drm_bridge *bridge) @@ -397,20 +381,6 @@ sti_dvo_connector_detect(struct drm_connector *connector, bool force) return connector_status_disconnected; } -static int sti_dvo_late_register(struct drm_connector *connector) -{ - struct sti_dvo_connector *dvo_connector - = to_sti_dvo_connector(connector); - struct sti_dvo *dvo = dvo_connector->dvo; - - if (dvo_debugfs_init(dvo, dvo->drm_dev->primary)) { - DRM_ERROR("DVO debugfs setup failed\n"); - return -EINVAL; - } - - return 0; -} - static const struct drm_connector_funcs sti_dvo_connector_funcs = { .fill_modes = drm_helper_probe_single_connector_modes, .detect = sti_dvo_connector_detect, @@ -418,7 +388,7 @@ static const struct drm_connector_funcs sti_dvo_connector_funcs = { .reset = drm_atomic_helper_connector_reset, .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, - .late_register = sti_dvo_late_register, + .atomic_print_state = sti_dvo_print_state, }; static struct drm_encoder *sti_dvo_find_encoder(struct drm_device *dev) diff --git a/drivers/gpu/drm/sti/sti_hda.c b/drivers/gpu/drm/sti/sti_hda.c index 67bbdb49fffc..0734f2751505 100644 --- a/drivers/gpu/drm/sti/sti_hda.c +++ b/drivers/gpu/drm/sti/sti_hda.c @@ -307,71 +307,56 @@ static void hda_enable_hd_dacs(struct sti_hda *hda, bool enable) } } -#define DBGFS_DUMP(reg) seq_printf(s, "\n %-25s 0x%08X", #reg, \ +#define DBGFS_DUMP(reg) drm_printf(p, "\n\t\t%-25s 0x%08X", #reg, \ readl(hda->regs + reg)) -static void hda_dbg_cfg(struct seq_file *s, int val) +static void hda_dbg_cfg(struct drm_printer *p, int val) { - seq_puts(s, "\tAWG "); - seq_puts(s, val & CFG_AWG_ASYNC_EN ? "enabled" : "disabled"); + drm_printf(p, "\tAWG "); + drm_printf(p, val & CFG_AWG_ASYNC_EN ? "enabled" : "disabled"); } -static void hda_dbg_awg_microcode(struct seq_file *s, void __iomem *reg) +static void hda_dbg_awg_microcode(struct drm_printer *p, void __iomem *reg) { unsigned int i; - seq_puts(s, "\n\n HDA AWG microcode:"); + drm_printf(p, "\n\n HDA AWG microcode:"); for (i = 0; i < AWG_MAX_INST; i++) { if (i % 8 == 0) - seq_printf(s, "\n %04X:", i); - seq_printf(s, " %04X", readl(reg + i * 4)); + drm_printf(p, "\n %04X:", i); + drm_printf(p, " %04X", readl(reg + i * 4)); } } -static void hda_dbg_video_dacs_ctrl(struct seq_file *s, void __iomem *reg) +static void hda_dbg_video_dacs_ctrl(struct drm_printer *p, void __iomem *reg) { u32 val = readl(reg); - seq_printf(s, "\n\n %-25s 0x%08X", "VIDEO_DACS_CONTROL", val); - seq_puts(s, "\tHD DACs "); - seq_puts(s, val & DAC_CFG_HD_HZUVW_OFF_MASK ? "disabled" : "enabled"); + drm_printf(p, "\n\n %-25s 0x%08X", "VIDEO_DACS_CONTROL", val); + drm_printf(p, "\tHD DACs "); + drm_printf(p, val & DAC_CFG_HD_HZUVW_OFF_MASK ? "disabled" : "enabled"); } -static int hda_dbg_show(struct seq_file *s, void *data) +static void sti_hda_print_state(struct drm_printer *p, + const struct drm_connector_state *state) { - struct drm_info_node *node = s->private; - struct sti_hda *hda = (struct sti_hda *)node->info_ent->data; + struct sti_hda_connector *hda_connector + = to_sti_hda_connector(state->connector); + struct sti_hda *hda = hda_connector->hda; - seq_printf(s, "HD Analog: (vaddr = 0x%p)", hda->regs); + drm_printf(p, "HD Analog: (vaddr = 0x%pK)", hda->regs); DBGFS_DUMP(HDA_ANA_CFG); - hda_dbg_cfg(s, readl(hda->regs + HDA_ANA_CFG)); + hda_dbg_cfg(p, readl(hda->regs + HDA_ANA_CFG)); DBGFS_DUMP(HDA_ANA_SCALE_CTRL_Y); DBGFS_DUMP(HDA_ANA_SCALE_CTRL_CB); DBGFS_DUMP(HDA_ANA_SCALE_CTRL_CR); DBGFS_DUMP(HDA_ANA_ANC_CTRL); DBGFS_DUMP(HDA_ANA_SRC_Y_CFG); DBGFS_DUMP(HDA_ANA_SRC_C_CFG); - hda_dbg_awg_microcode(s, hda->regs + HDA_SYNC_AWGI); + hda_dbg_awg_microcode(p, hda->regs + HDA_SYNC_AWGI); if (hda->video_dacs_ctrl) - hda_dbg_video_dacs_ctrl(s, hda->video_dacs_ctrl); - seq_putc(s, '\n'); - return 0; -} - -static struct drm_info_list hda_debugfs_files[] = { - { "hda", hda_dbg_show, 0, NULL }, -}; - -static int hda_debugfs_init(struct sti_hda *hda, struct drm_minor *minor) -{ - unsigned int i; - - for (i = 0; i < ARRAY_SIZE(hda_debugfs_files); i++) - hda_debugfs_files[i].data = hda; - - return drm_debugfs_create_files(hda_debugfs_files, - ARRAY_SIZE(hda_debugfs_files), - minor->debugfs_root, minor); + hda_dbg_video_dacs_ctrl(p, hda->video_dacs_ctrl); + drm_printf(p, "\n"); } /** @@ -632,27 +617,13 @@ struct drm_connector_helper_funcs sti_hda_connector_helper_funcs = { .mode_valid = sti_hda_connector_mode_valid, }; -static int sti_hda_late_register(struct drm_connector *connector) -{ - struct sti_hda_connector *hda_connector - = to_sti_hda_connector(connector); - struct sti_hda *hda = hda_connector->hda; - - if (hda_debugfs_init(hda, hda->drm_dev->primary)) { - DRM_ERROR("HDA debugfs setup failed\n"); - return -EINVAL; - } - - return 0; -} - static const struct drm_connector_funcs sti_hda_connector_funcs = { .fill_modes = drm_helper_probe_single_connector_modes, .destroy = drm_connector_cleanup, .reset = drm_atomic_helper_connector_reset, .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, - .late_register = sti_hda_late_register, + .atomic_print_state = sti_hda_print_state, }; static struct drm_encoder *sti_hda_find_encoder(struct drm_device *dev) diff --git a/drivers/gpu/drm/sti/sti_hdmi.c b/drivers/gpu/drm/sti/sti_hdmi.c index 58f431102512..b1313b3321bf 100644 --- a/drivers/gpu/drm/sti/sti_hdmi.c +++ b/drivers/gpu/drm/sti/sti_hdmi.c @@ -584,49 +584,49 @@ static void hdmi_swreset(struct sti_hdmi *hdmi) clk_disable_unprepare(hdmi->clk_audio); } -#define DBGFS_PRINT_STR(str1, str2) seq_printf(s, "%-24s %s\n", str1, str2) -#define DBGFS_PRINT_INT(str1, int2) seq_printf(s, "%-24s %d\n", str1, int2) -#define DBGFS_DUMP(str, reg) seq_printf(s, "%s %-25s 0x%08X", str, #reg, \ +#define DBGFS_PRINT_STR(str1, str2) drm_printf(p, "%-24s %s\n", str1, str2) +#define DBGFS_PRINT_INT(str1, int2) drm_printf(p, "%-24s %d\n", str1, int2) +#define DBGFS_DUMP(str, reg) drm_printf(p, "%s\t%-25s 0x%08X", str, #reg, \ hdmi_read(hdmi, reg)) -#define DBGFS_DUMP_DI(reg, slot) DBGFS_DUMP("\n", reg(slot)) +#define DBGFS_DUMP_DI(reg, slot) DBGFS_DUMP("\n\t\t", reg(slot)) -static void hdmi_dbg_cfg(struct seq_file *s, int val) +static void hdmi_dbg_cfg(struct drm_printer *p, int val) { int tmp; - seq_putc(s, '\t'); + drm_printf(p, "\t"); tmp = val & HDMI_CFG_HDMI_NOT_DVI; DBGFS_PRINT_STR("mode:", tmp ? "HDMI" : "DVI"); - seq_puts(s, "\t\t\t\t\t"); + drm_printf(p, "\t\t\t\t\t"); tmp = val & HDMI_CFG_HDCP_EN; DBGFS_PRINT_STR("HDCP:", tmp ? "enable" : "disable"); - seq_puts(s, "\t\t\t\t\t"); + drm_printf(p, "\t\t\t\t\t"); tmp = val & HDMI_CFG_ESS_NOT_OESS; DBGFS_PRINT_STR("HDCP mode:", tmp ? "ESS enable" : "OESS enable"); - seq_puts(s, "\t\t\t\t\t"); + drm_printf(p, "\t\t\t\t\t"); tmp = val & HDMI_CFG_H_SYNC_POL_NEG; DBGFS_PRINT_STR("Hsync polarity:", tmp ? "inverted" : "normal"); - seq_puts(s, "\t\t\t\t\t"); + drm_printf(p, "\t\t\t\t\t"); tmp = val & HDMI_CFG_V_SYNC_POL_NEG; DBGFS_PRINT_STR("Vsync polarity:", tmp ? "inverted" : "normal"); - seq_puts(s, "\t\t\t\t\t"); + drm_printf(p, "\t\t\t\t\t"); tmp = val & HDMI_CFG_422_EN; DBGFS_PRINT_STR("YUV422 format:", tmp ? "enable" : "disable"); } -static void hdmi_dbg_sta(struct seq_file *s, int val) +static void hdmi_dbg_sta(struct drm_printer *p, int val) { int tmp; - seq_putc(s, '\t'); + drm_printf(p, "\t"); tmp = (val & HDMI_STA_DLL_LCK); DBGFS_PRINT_STR("pll:", tmp ? "locked" : "not locked"); - seq_puts(s, "\t\t\t\t\t"); + drm_printf(p, "\t\t\t\t\t"); tmp = (val & HDMI_STA_HOT_PLUG); DBGFS_PRINT_STR("hdmi cable:", tmp ? "connected" : "not connected"); } -static void hdmi_dbg_sw_di_cfg(struct seq_file *s, int val) +static void hdmi_dbg_sw_di_cfg(struct drm_printer *p, int val) { int tmp; char *const en_di[] = {"no transmission", @@ -634,57 +634,59 @@ static void hdmi_dbg_sw_di_cfg(struct seq_file *s, int val) "once every field", "once every frame"}; - seq_putc(s, '\t'); + drm_printf(p, "\t"); tmp = (val & HDMI_IFRAME_CFG_DI_N(HDMI_IFRAME_MASK, 1)); DBGFS_PRINT_STR("Data island 1:", en_di[tmp]); - seq_puts(s, "\t\t\t\t\t"); + drm_printf(p, "\t\t\t\t\t"); tmp = (val & HDMI_IFRAME_CFG_DI_N(HDMI_IFRAME_MASK, 2)) >> 4; DBGFS_PRINT_STR("Data island 2:", en_di[tmp]); - seq_puts(s, "\t\t\t\t\t"); + drm_printf(p, "\t\t\t\t\t"); tmp = (val & HDMI_IFRAME_CFG_DI_N(HDMI_IFRAME_MASK, 3)) >> 8; DBGFS_PRINT_STR("Data island 3:", en_di[tmp]); - seq_puts(s, "\t\t\t\t\t"); + drm_printf(p, "\t\t\t\t\t"); tmp = (val & HDMI_IFRAME_CFG_DI_N(HDMI_IFRAME_MASK, 4)) >> 12; DBGFS_PRINT_STR("Data island 4:", en_di[tmp]); - seq_puts(s, "\t\t\t\t\t"); + drm_printf(p, "\t\t\t\t\t"); tmp = (val & HDMI_IFRAME_CFG_DI_N(HDMI_IFRAME_MASK, 5)) >> 16; DBGFS_PRINT_STR("Data island 5:", en_di[tmp]); - seq_puts(s, "\t\t\t\t\t"); + drm_printf(p, "\t\t\t\t\t"); tmp = (val & HDMI_IFRAME_CFG_DI_N(HDMI_IFRAME_MASK, 6)) >> 20; DBGFS_PRINT_STR("Data island 6:", en_di[tmp]); } -static int hdmi_dbg_show(struct seq_file *s, void *data) +static void sti_hdmi_print_state(struct drm_printer *p, + const struct drm_connector_state *state) { - struct drm_info_node *node = s->private; - struct sti_hdmi *hdmi = (struct sti_hdmi *)node->info_ent->data; - - seq_printf(s, "HDMI: (vaddr = 0x%p)", hdmi->regs); - DBGFS_DUMP("\n", HDMI_CFG); - hdmi_dbg_cfg(s, hdmi_read(hdmi, HDMI_CFG)); - DBGFS_DUMP("", HDMI_INT_EN); - DBGFS_DUMP("\n", HDMI_STA); - hdmi_dbg_sta(s, hdmi_read(hdmi, HDMI_STA)); - DBGFS_DUMP("", HDMI_ACTIVE_VID_XMIN); - seq_putc(s, '\t'); + struct sti_hdmi_connector *hdmi_connector + = to_sti_hdmi_connector(state->connector); + struct sti_hdmi *hdmi = hdmi_connector->hdmi; + + drm_printf(p, "\tHDMI: (vaddr = 0x%pK)", hdmi->regs); + DBGFS_DUMP("\n\t\t", HDMI_CFG); + hdmi_dbg_cfg(p, hdmi_read(hdmi, HDMI_CFG)); + DBGFS_DUMP("\t\t", HDMI_INT_EN); + DBGFS_DUMP("\n\t\t", HDMI_STA); + hdmi_dbg_sta(p, hdmi_read(hdmi, HDMI_STA)); + DBGFS_DUMP("\t\t", HDMI_ACTIVE_VID_XMIN); + drm_printf(p, "\t"); DBGFS_PRINT_INT("Xmin:", hdmi_read(hdmi, HDMI_ACTIVE_VID_XMIN)); - DBGFS_DUMP("", HDMI_ACTIVE_VID_XMAX); - seq_putc(s, '\t'); + DBGFS_DUMP("\t\t", HDMI_ACTIVE_VID_XMAX); + drm_printf(p, "\t"); DBGFS_PRINT_INT("Xmax:", hdmi_read(hdmi, HDMI_ACTIVE_VID_XMAX)); - DBGFS_DUMP("", HDMI_ACTIVE_VID_YMIN); - seq_putc(s, '\t'); + DBGFS_DUMP("\t\t", HDMI_ACTIVE_VID_YMIN); + drm_printf(p, "\t"); DBGFS_PRINT_INT("Ymin:", hdmi_read(hdmi, HDMI_ACTIVE_VID_YMIN)); - DBGFS_DUMP("", HDMI_ACTIVE_VID_YMAX); - seq_putc(s, '\t'); + DBGFS_DUMP("\t\t", HDMI_ACTIVE_VID_YMAX); + drm_printf(p, "\t"); DBGFS_PRINT_INT("Ymax:", hdmi_read(hdmi, HDMI_ACTIVE_VID_YMAX)); - DBGFS_DUMP("", HDMI_SW_DI_CFG); - hdmi_dbg_sw_di_cfg(s, hdmi_read(hdmi, HDMI_SW_DI_CFG)); + DBGFS_DUMP("\t\t", HDMI_SW_DI_CFG); + hdmi_dbg_sw_di_cfg(p, hdmi_read(hdmi, HDMI_SW_DI_CFG)); - DBGFS_DUMP("\n", HDMI_AUDIO_CFG); - DBGFS_DUMP("\n", HDMI_SPDIF_FIFO_STATUS); - DBGFS_DUMP("\n", HDMI_AUDN); + DBGFS_DUMP("\n\t\t", HDMI_AUDIO_CFG); + DBGFS_DUMP("\n\t\t", HDMI_SPDIF_FIFO_STATUS); + DBGFS_DUMP("\n\t\t", HDMI_AUDN); - seq_printf(s, "\n AVI Infoframe (Data Island slot N=%d):", + drm_printf(p, "\n\t\tAVI Infoframe (Data Island slot N=%d):", HDMI_IFRAME_SLOT_AVI); DBGFS_DUMP_DI(HDMI_SW_DI_N_HEAD_WORD, HDMI_IFRAME_SLOT_AVI); DBGFS_DUMP_DI(HDMI_SW_DI_N_PKT_WORD0, HDMI_IFRAME_SLOT_AVI); @@ -694,7 +696,7 @@ static int hdmi_dbg_show(struct seq_file *s, void *data) DBGFS_DUMP_DI(HDMI_SW_DI_N_PKT_WORD4, HDMI_IFRAME_SLOT_AVI); DBGFS_DUMP_DI(HDMI_SW_DI_N_PKT_WORD5, HDMI_IFRAME_SLOT_AVI); DBGFS_DUMP_DI(HDMI_SW_DI_N_PKT_WORD6, HDMI_IFRAME_SLOT_AVI); - seq_printf(s, "\n\n AUDIO Infoframe (Data Island slot N=%d):", + drm_printf(p, "\n\t\tAUDIO Infoframe (Data Island slot N=%d):", HDMI_IFRAME_SLOT_AUDIO); DBGFS_DUMP_DI(HDMI_SW_DI_N_HEAD_WORD, HDMI_IFRAME_SLOT_AUDIO); DBGFS_DUMP_DI(HDMI_SW_DI_N_PKT_WORD0, HDMI_IFRAME_SLOT_AUDIO); @@ -704,7 +706,8 @@ static int hdmi_dbg_show(struct seq_file *s, void *data) DBGFS_DUMP_DI(HDMI_SW_DI_N_PKT_WORD4, HDMI_IFRAME_SLOT_AUDIO); DBGFS_DUMP_DI(HDMI_SW_DI_N_PKT_WORD5, HDMI_IFRAME_SLOT_AUDIO); DBGFS_DUMP_DI(HDMI_SW_DI_N_PKT_WORD6, HDMI_IFRAME_SLOT_AUDIO); - seq_printf(s, "\n\n VENDOR SPECIFIC Infoframe (Data Island slot N=%d):", + drm_printf(p, + "\n\t\tVENDOR SPECIFIC Infoframe (Data Island slot N=%d):", HDMI_IFRAME_SLOT_VENDOR); DBGFS_DUMP_DI(HDMI_SW_DI_N_HEAD_WORD, HDMI_IFRAME_SLOT_VENDOR); DBGFS_DUMP_DI(HDMI_SW_DI_N_PKT_WORD0, HDMI_IFRAME_SLOT_VENDOR); @@ -714,24 +717,7 @@ static int hdmi_dbg_show(struct seq_file *s, void *data) DBGFS_DUMP_DI(HDMI_SW_DI_N_PKT_WORD4, HDMI_IFRAME_SLOT_VENDOR); DBGFS_DUMP_DI(HDMI_SW_DI_N_PKT_WORD5, HDMI_IFRAME_SLOT_VENDOR); DBGFS_DUMP_DI(HDMI_SW_DI_N_PKT_WORD6, HDMI_IFRAME_SLOT_VENDOR); - seq_putc(s, '\n'); - return 0; -} - -static struct drm_info_list hdmi_debugfs_files[] = { - { "hdmi", hdmi_dbg_show, 0, NULL }, -}; - -static int hdmi_debugfs_init(struct sti_hdmi *hdmi, struct drm_minor *minor) -{ - unsigned int i; - - for (i = 0; i < ARRAY_SIZE(hdmi_debugfs_files); i++) - hdmi_debugfs_files[i].data = hdmi; - - return drm_debugfs_create_files(hdmi_debugfs_files, - ARRAY_SIZE(hdmi_debugfs_files), - minor->debugfs_root, minor); + drm_printf(p, "\n"); } static void sti_hdmi_disable(struct drm_bridge *bridge) @@ -1099,20 +1085,6 @@ sti_hdmi_connector_get_property(struct drm_connector *connector, return -EINVAL; } -static int sti_hdmi_late_register(struct drm_connector *connector) -{ - struct sti_hdmi_connector *hdmi_connector - = to_sti_hdmi_connector(connector); - struct sti_hdmi *hdmi = hdmi_connector->hdmi; - - if (hdmi_debugfs_init(hdmi, hdmi->drm_dev->primary)) { - DRM_ERROR("HDMI debugfs setup failed\n"); - return -EINVAL; - } - - return 0; -} - static const struct drm_connector_funcs sti_hdmi_connector_funcs = { .fill_modes = drm_helper_probe_single_connector_modes, .detect = sti_hdmi_connector_detect, @@ -1122,7 +1094,7 @@ static const struct drm_connector_funcs sti_hdmi_connector_funcs = { .atomic_get_property = sti_hdmi_connector_get_property, .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, - .late_register = sti_hdmi_late_register, + .atomic_print_state = sti_hdmi_print_state, }; static struct drm_encoder *sti_hdmi_find_encoder(struct drm_device *dev) From patchwork Tue Jun 5 13:54:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 137747 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp990690lji; Tue, 5 Jun 2018 06:54:55 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIuFNEMkAZ+OozM4PWliDgHk+RKZuUzcoPBnx6hvdPOudvSVT/6bn/2xhu/P1hCtFqIMlhm X-Received: by 2002:a17:902:8f93:: with SMTP id z19-v6mr26212204plo.166.1528206895832; Tue, 05 Jun 2018 06:54:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528206895; cv=none; d=google.com; s=arc-20160816; b=xAcDf8xZYiLHFcsPnOpbgsiNNTJVjC2JAHp1F/A0necZVDA4jpgVwn9kEw+fORDPQx 6d6Lo46cHS8rvsTUhWkU9ODD5rPjvz1b2fHZvp+mL0mHSt3ydQgCMzSKwSz2otYX1fQP Z5i1ooV2UVEliSPn5FAIEyuK07zXOUiXBig0DyGttfBpeVrBf99k9oLiUiqA20FoiL2w UwFpzATlp7p5Lsllwgs1sUzqcZA2dCIfK3pyq2dxBWhLYqaoHDHQ0khbWtaMdyIRfO5A 9jeoHDPYMhjSUXT9dADOlRMaNOVF/YCS4MeeXoD+dYc7ioP69t40jUuZXbs9qYTz2gc8 u73g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:references:in-reply-to:message-id:date:subject :to:from:delivered-to:arc-authentication-results; bh=FRuggIvqCCrMnDB1AMnCE0KZlDaywiWGY8+zzL4+Mpo=; b=sd8wwB3WQEoaOLxIF2G7VA4q2e3S4TfPeVJDnhAct4swFf7/W0VklGcA2e4W5eI/4L f3FNYN+JVboiXnau3xuvR0YHpnEahLBtsOAPBXGVGgr4LjUSJjeJPru6g8ftwJ1zl/SM NRgiwTXF3BHMZSEIvmnuqWy7mXgv5+alGPZYD6CjDO0JQg42wQ4oiW84OZ5YsXq0HJTI /5wq17Pd8XeHVaoq2UHlqvXINXlDoaSLSBamBexe/Y9cg/4Sn7uCF4fwuy6yIyiJ5LXU PuewSR+8k/bsK4584zNXltEnWinEB2aIq2FPoi5TZwCBtBZ8BBOXhNbK66GvkyNS9Srn RvqQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id g23-v6si12705240pli.110.2018.06.05.06.54.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Jun 2018 06:54:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6634B6EDD5; Tue, 5 Jun 2018 13:54:34 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr0-x242.google.com (mail-wr0-x242.google.com [IPv6:2a00:1450:400c:c0c::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id 22C836EDD1 for ; Tue, 5 Jun 2018 13:54:32 +0000 (UTC) Received: by mail-wr0-x242.google.com with SMTP id w10-v6so2529773wrk.9 for ; Tue, 05 Jun 2018 06:54:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=VNxdYxKMHvxaelSO8suxrNqQwKFz+w/ucCpcuROjL6w=; b=sP4B3kZtMMNzcJatu+9uqoyDudDs1GV4BweHmSLPhf9DQf8a7oN3ivJIlVfSCufpy4 woYR6wI6EnqmeZTr7c4Dld0cGpCUhd1T60e6So+/8PHv7wQ5iYSgaFVuvEGwpBHm7tZJ E09EBR9dORALjILKSfjibxNbTPySajo1LpetceQGF4u3uuVEmC7GWcJadYNIKyZdwsBw 3JC2Vnee1cRGnaWPorlTNbVEevlbVznvo3P10pd4UmYbuLOhGUY7HWtOu4jxawHT7CcI FfP5cAN0MAma+/bVmpzsD0GCUJ7akfrYBabYhTapalKXVbffEd8lzBykqQwVKCntO3ir ISkg== X-Gm-Message-State: ALKqPwcBIdGKBhDDT1MWz82xM5wP/CnMt7FlGXs6muzq1HUee1Bpo2gi Nb9fJmp9ytQ4dj/L59eV8KXD+A== X-Received: by 2002:adf:dfc2:: with SMTP id q2-v6mr17732177wrn.113.1528206870604; Tue, 05 Jun 2018 06:54:30 -0700 (PDT) Received: from lmecxl0911.lme.st.com (bol62-h02-176-179-166-238.dsl.sta.abo.bbox.fr. [176.179.166.238]) by smtp.gmail.com with ESMTPSA id o53-v6sm76797785wrc.96.2018.06.05.06.54.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 05 Jun 2018 06:54:29 -0700 (PDT) From: Benjamin Gaignard To: gustavo@padovan.org, maarten.lankhorst@linux.intel.com, seanpaul@chromium.org, airlied@linux.ie, vincent.abriou@st.com Subject: [PATCH v1 5/7] drm: sti: make crtc use atomic_print_state instead of debugfs Date: Tue, 5 Jun 2018 15:54:05 +0200 Message-Id: <20180605135407.20214-6-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20180605135407.20214-1-benjamin.gaignard@linaro.org> References: <20180605135407.20214-1-benjamin.gaignard@linaro.org> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Convert sti crtc to atomic_print_state usage rather than use a debugfs entry. Signed-off-by: Benjamin Gaignard Reviewed-by: Philippe Cornu --- drivers/gpu/drm/sti/sti_compositor.c | 16 ------- drivers/gpu/drm/sti/sti_compositor.h | 3 -- drivers/gpu/drm/sti/sti_crtc.c | 17 ++++--- drivers/gpu/drm/sti/sti_mixer.c | 89 ++++++++++-------------------------- drivers/gpu/drm/sti/sti_mixer.h | 3 +- drivers/gpu/drm/sti/sti_vid.c | 60 ++++++++---------------- drivers/gpu/drm/sti/sti_vid.h | 2 +- 7 files changed, 59 insertions(+), 131 deletions(-) diff --git a/drivers/gpu/drm/sti/sti_compositor.c b/drivers/gpu/drm/sti/sti_compositor.c index 021b8fcaa0b9..c08d5c560557 100644 --- a/drivers/gpu/drm/sti/sti_compositor.c +++ b/drivers/gpu/drm/sti/sti_compositor.c @@ -39,22 +39,6 @@ static const struct sti_compositor_data stih407_compositor_data = { }, }; -int sti_compositor_debugfs_init(struct sti_compositor *compo, - struct drm_minor *minor) -{ - unsigned int i; - - for (i = 0; i < STI_MAX_VID; i++) - if (compo->vid[i]) - vid_debugfs_init(compo->vid[i], minor); - - for (i = 0; i < STI_MAX_MIXER; i++) - if (compo->mixer[i]) - sti_mixer_debugfs_init(compo->mixer[i], minor); - - return 0; -} - static int sti_compositor_bind(struct device *dev, struct device *master, void *data) diff --git a/drivers/gpu/drm/sti/sti_compositor.h b/drivers/gpu/drm/sti/sti_compositor.h index ac4bb3834810..eb8b233e68a2 100644 --- a/drivers/gpu/drm/sti/sti_compositor.h +++ b/drivers/gpu/drm/sti/sti_compositor.h @@ -79,7 +79,4 @@ struct sti_compositor { struct notifier_block vtg_vblank_nb[STI_MAX_MIXER]; }; -int sti_compositor_debugfs_init(struct sti_compositor *compo, - struct drm_minor *minor); - #endif diff --git a/drivers/gpu/drm/sti/sti_crtc.c b/drivers/gpu/drm/sti/sti_crtc.c index 5824e6aca8f4..4e137932ffe4 100644 --- a/drivers/gpu/drm/sti/sti_crtc.c +++ b/drivers/gpu/drm/sti/sti_crtc.c @@ -316,15 +316,20 @@ void sti_crtc_disable_vblank(struct drm_device *drm_dev, unsigned int pipe) DRM_DEBUG_DRIVER("Warning: cannot unregister VTG notifier\n"); } -static int sti_crtc_late_register(struct drm_crtc *crtc) +static void sti_crtc_print_state(struct drm_printer *p, + const struct drm_crtc_state *state) { - struct sti_mixer *mixer = to_sti_mixer(crtc); + struct sti_mixer *mixer = to_sti_mixer(state->crtc); struct sti_compositor *compo = dev_get_drvdata(mixer->dev); + unsigned int i; - if (drm_crtc_index(crtc) == 0) - return sti_compositor_debugfs_init(compo, crtc->dev->primary); + for (i = 0; i < STI_MAX_VID; i++) + if (compo->vid[i]) + sti_vid_print_state(p, compo->vid[i]); - return 0; + for (i = 0; i < STI_MAX_MIXER; i++) + if (compo->mixer[i]) + sti_mixer_print_state(p, compo->mixer[i]); } static const struct drm_crtc_funcs sti_crtc_funcs = { @@ -335,7 +340,7 @@ static const struct drm_crtc_funcs sti_crtc_funcs = { .reset = drm_atomic_helper_crtc_reset, .atomic_duplicate_state = drm_atomic_helper_crtc_duplicate_state, .atomic_destroy_state = drm_atomic_helper_crtc_destroy_state, - .late_register = sti_crtc_late_register, + .atomic_print_state = sti_crtc_print_state, }; bool sti_crtc_is_main(struct drm_crtc *crtc) diff --git a/drivers/gpu/drm/sti/sti_mixer.c b/drivers/gpu/drm/sti/sti_mixer.c index a4f45c74d678..22525139d315 100644 --- a/drivers/gpu/drm/sti/sti_mixer.c +++ b/drivers/gpu/drm/sti/sti_mixer.c @@ -70,20 +70,20 @@ static inline void sti_mixer_reg_write(struct sti_mixer *mixer, writel(val, mixer->regs + reg_id); } -#define DBGFS_DUMP(reg) seq_printf(s, "\n %-25s 0x%08X", #reg, \ +#define DBGFS_DUMP(reg) drm_printf(p, "\n\t\t%-25s 0x%08X", #reg, \ sti_mixer_reg_read(mixer, reg)) -static void mixer_dbg_ctl(struct seq_file *s, int val) +static void mixer_dbg_ctl(struct drm_printer *p, int val) { unsigned int i; int count = 0; char *const disp_layer[] = {"BKG", "VID0", "VID1", "GDP0", "GDP1", "GDP2", "GDP3"}; - seq_puts(s, "\tEnabled: "); + drm_printf(p, "\tEnabled: "); for (i = 0; i < 7; i++) { if (val & 1) { - seq_printf(s, "%s ", disp_layer[i]); + drm_printf(p, "%s ", disp_layer[i]); count++; } val = val >> 1; @@ -91,114 +91,75 @@ static void mixer_dbg_ctl(struct seq_file *s, int val) val = val >> 2; if (val & 1) { - seq_puts(s, "CURS "); + drm_printf(p, "CURS "); count++; } if (!count) - seq_puts(s, "Nothing"); + drm_printf(p, "Nothing"); } -static void mixer_dbg_crb(struct seq_file *s, int val) +static void mixer_dbg_crb(struct drm_printer *p, int val) { int i; - seq_puts(s, "\tDepth: "); + drm_printf(p, "\tDepth: "); for (i = 0; i < GAM_MIXER_NB_DEPTH_LEVEL; i++) { switch (val & GAM_DEPTH_MASK_ID) { case GAM_DEPTH_VID0_ID: - seq_puts(s, "VID0"); + drm_printf(p, "VID0"); break; case GAM_DEPTH_VID1_ID: - seq_puts(s, "VID1"); + drm_printf(p, "VID1"); break; case GAM_DEPTH_GDP0_ID: - seq_puts(s, "GDP0"); + drm_printf(p, "GDP0"); break; case GAM_DEPTH_GDP1_ID: - seq_puts(s, "GDP1"); + drm_printf(p, "GDP1"); break; case GAM_DEPTH_GDP2_ID: - seq_puts(s, "GDP2"); + drm_printf(p, "GDP2"); break; case GAM_DEPTH_GDP3_ID: - seq_puts(s, "GDP3"); + drm_printf(p, "GDP3"); break; default: - seq_puts(s, "---"); + drm_printf(p, "---"); } if (i < GAM_MIXER_NB_DEPTH_LEVEL - 1) - seq_puts(s, " < "); + drm_printf(p, " < "); val = val >> 3; } } -static void mixer_dbg_mxn(struct seq_file *s, void *addr) +static void mixer_dbg_mxn(struct drm_printer *p, void *addr) { int i; for (i = 1; i < 8; i++) - seq_printf(s, "-0x%08X", (int)readl(addr + i * 4)); + drm_printf(p, "-0x%08X", (int)readl(addr + i * 4)); } -static int mixer_dbg_show(struct seq_file *s, void *arg) +void sti_mixer_print_state(struct drm_printer *p, struct sti_mixer *mixer) { - struct drm_info_node *node = s->private; - struct sti_mixer *mixer = (struct sti_mixer *)node->info_ent->data; - - seq_printf(s, "%s: (vaddr = 0x%p)", + drm_printf(p, "\t%s: (vaddr = 0x%pK)", sti_mixer_to_str(mixer), mixer->regs); DBGFS_DUMP(GAM_MIXER_CTL); - mixer_dbg_ctl(s, sti_mixer_reg_read(mixer, GAM_MIXER_CTL)); + mixer_dbg_ctl(p, sti_mixer_reg_read(mixer, GAM_MIXER_CTL)); DBGFS_DUMP(GAM_MIXER_BKC); DBGFS_DUMP(GAM_MIXER_BCO); DBGFS_DUMP(GAM_MIXER_BCS); DBGFS_DUMP(GAM_MIXER_AVO); DBGFS_DUMP(GAM_MIXER_AVS); DBGFS_DUMP(GAM_MIXER_CRB); - mixer_dbg_crb(s, sti_mixer_reg_read(mixer, GAM_MIXER_CRB)); + mixer_dbg_crb(p, sti_mixer_reg_read(mixer, GAM_MIXER_CRB)); DBGFS_DUMP(GAM_MIXER_ACT); DBGFS_DUMP(GAM_MIXER_MBP); DBGFS_DUMP(GAM_MIXER_MX0); - mixer_dbg_mxn(s, mixer->regs + GAM_MIXER_MX0); - seq_putc(s, '\n'); - return 0; -} - -static struct drm_info_list mixer0_debugfs_files[] = { - { "mixer_main", mixer_dbg_show, 0, NULL }, -}; - -static struct drm_info_list mixer1_debugfs_files[] = { - { "mixer_aux", mixer_dbg_show, 0, NULL }, -}; - -int sti_mixer_debugfs_init(struct sti_mixer *mixer, struct drm_minor *minor) -{ - unsigned int i; - struct drm_info_list *mixer_debugfs_files; - int nb_files; - - switch (mixer->id) { - case STI_MIXER_MAIN: - mixer_debugfs_files = mixer0_debugfs_files; - nb_files = ARRAY_SIZE(mixer0_debugfs_files); - break; - case STI_MIXER_AUX: - mixer_debugfs_files = mixer1_debugfs_files; - nb_files = ARRAY_SIZE(mixer1_debugfs_files); - break; - default: - return -EINVAL; - } - - for (i = 0; i < nb_files; i++) - mixer_debugfs_files[i].data = mixer; - - return drm_debugfs_create_files(mixer_debugfs_files, - nb_files, - minor->debugfs_root, minor); + mixer_dbg_mxn(p, mixer->regs + GAM_MIXER_MX0); + drm_printf(p, "\n"); } void sti_mixer_set_background_status(struct sti_mixer *mixer, bool enable) @@ -367,7 +328,7 @@ struct sti_mixer *sti_mixer_create(struct device *dev, mixer->dev = dev; mixer->id = id; - DRM_DEBUG_DRIVER("%s created. Regs=%p\n", + DRM_DEBUG_DRIVER("%s created. Regs=%pK\n", sti_mixer_to_str(mixer), mixer->regs); return mixer; diff --git a/drivers/gpu/drm/sti/sti_mixer.h b/drivers/gpu/drm/sti/sti_mixer.h index 4cb3cfddc03a..067093270bb0 100644 --- a/drivers/gpu/drm/sti/sti_mixer.h +++ b/drivers/gpu/drm/sti/sti_mixer.h @@ -53,7 +53,8 @@ int sti_mixer_active_video_area(struct sti_mixer *mixer, void sti_mixer_set_background_status(struct sti_mixer *mixer, bool enable); -int sti_mixer_debugfs_init(struct sti_mixer *mixer, struct drm_minor *minor); +void sti_mixer_print_state(struct drm_printer *p, struct sti_mixer *mixer); + /* depth in Cross-bar control = z order */ #define GAM_MIXER_NB_DEPTH_LEVEL 6 diff --git a/drivers/gpu/drm/sti/sti_vid.c b/drivers/gpu/drm/sti/sti_vid.c index 2aac36c95835..9730e9cf2a87 100644 --- a/drivers/gpu/drm/sti/sti_vid.c +++ b/drivers/gpu/drm/sti/sti_vid.c @@ -55,54 +55,51 @@ #define VID_MIN_HD_HEIGHT 720 -#define DBGFS_DUMP(reg) seq_printf(s, "\n %-25s 0x%08X", #reg, \ +#define DBGFS_DUMP(reg) drm_printf(p, "\n\t\t%-25s 0x%08X", #reg, \ readl(vid->regs + reg)) -static void vid_dbg_ctl(struct seq_file *s, int val) +static void vid_dbg_ctl(struct drm_printer *p, int val) { val = val >> 30; - seq_putc(s, '\t'); + drm_printf(p, "\t"); if (!(val & 1)) - seq_puts(s, "NOT "); - seq_puts(s, "ignored on main mixer - "); + drm_printf(p, "NOT "); + drm_printf(p, "ignored on main mixer - "); if (!(val & 2)) - seq_puts(s, "NOT "); - seq_puts(s, "ignored on aux mixer"); + drm_printf(p, "NOT "); + drm_printf(p, "ignored on aux mixer"); } -static void vid_dbg_vpo(struct seq_file *s, int val) +static void vid_dbg_vpo(struct drm_printer *p, int val) { - seq_printf(s, "\txdo:%4d\tydo:%4d", val & 0x0FFF, (val >> 16) & 0x0FFF); + drm_printf(p, "\txdo:%4d\tydo:%4d", val & 0x0FFF, (val >> 16) & 0x0FFF); } -static void vid_dbg_vps(struct seq_file *s, int val) +static void vid_dbg_vps(struct drm_printer *p, int val) { - seq_printf(s, "\txds:%4d\tyds:%4d", val & 0x0FFF, (val >> 16) & 0x0FFF); + drm_printf(p, "\txds:%4d\tyds:%4d", val & 0x0FFF, (val >> 16) & 0x0FFF); } -static void vid_dbg_mst(struct seq_file *s, int val) +static void vid_dbg_mst(struct drm_printer *p, int val) { if (val & 1) - seq_puts(s, "\tBUFFER UNDERFLOW!"); + drm_printf(p, "\tBUFFER UNDERFLOW!"); } -static int vid_dbg_show(struct seq_file *s, void *arg) +void sti_vid_print_state(struct drm_printer *p, struct sti_vid *vid) { - struct drm_info_node *node = s->private; - struct sti_vid *vid = (struct sti_vid *)node->info_ent->data; - - seq_printf(s, "VID: (vaddr= 0x%p)", vid->regs); + drm_printf(p, "\tVID: (vaddr= 0x%pK)", vid->regs); DBGFS_DUMP(VID_CTL); - vid_dbg_ctl(s, readl(vid->regs + VID_CTL)); + vid_dbg_ctl(p, readl(vid->regs + VID_CTL)); DBGFS_DUMP(VID_ALP); DBGFS_DUMP(VID_CLF); DBGFS_DUMP(VID_VPO); - vid_dbg_vpo(s, readl(vid->regs + VID_VPO)); + vid_dbg_vpo(p, readl(vid->regs + VID_VPO)); DBGFS_DUMP(VID_VPS); - vid_dbg_vps(s, readl(vid->regs + VID_VPS)); + vid_dbg_vps(p, readl(vid->regs + VID_VPS)); DBGFS_DUMP(VID_KEY1); DBGFS_DUMP(VID_KEY2); DBGFS_DUMP(VID_MPR0); @@ -110,28 +107,11 @@ static int vid_dbg_show(struct seq_file *s, void *arg) DBGFS_DUMP(VID_MPR2); DBGFS_DUMP(VID_MPR3); DBGFS_DUMP(VID_MST); - vid_dbg_mst(s, readl(vid->regs + VID_MST)); + vid_dbg_mst(p, readl(vid->regs + VID_MST)); DBGFS_DUMP(VID_BC); DBGFS_DUMP(VID_TINT); DBGFS_DUMP(VID_CSAT); - seq_putc(s, '\n'); - return 0; -} - -static struct drm_info_list vid_debugfs_files[] = { - { "vid", vid_dbg_show, 0, NULL }, -}; - -int vid_debugfs_init(struct sti_vid *vid, struct drm_minor *minor) -{ - unsigned int i; - - for (i = 0; i < ARRAY_SIZE(vid_debugfs_files); i++) - vid_debugfs_files[i].data = vid; - - return drm_debugfs_create_files(vid_debugfs_files, - ARRAY_SIZE(vid_debugfs_files), - minor->debugfs_root, minor); + drm_printf(p, "\n"); } void sti_vid_commit(struct sti_vid *vid, diff --git a/drivers/gpu/drm/sti/sti_vid.h b/drivers/gpu/drm/sti/sti_vid.h index 9dbd78461de1..27656dbbd2bc 100644 --- a/drivers/gpu/drm/sti/sti_vid.h +++ b/drivers/gpu/drm/sti/sti_vid.h @@ -26,6 +26,6 @@ void sti_vid_disable(struct sti_vid *vid); struct sti_vid *sti_vid_create(struct device *dev, struct drm_device *drm_dev, int id, void __iomem *baseaddr); -int vid_debugfs_init(struct sti_vid *vid, struct drm_minor *minor); +void sti_vid_print_state(struct drm_printer *p, struct sti_vid *vid); #endif