From patchwork Thu Apr 28 02:11:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sinclair Yeh X-Patchwork-Id: 8965271 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 88DFC9F441 for ; Thu, 28 Apr 2016 02:12:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A0948202A1 for ; Thu, 28 Apr 2016 02:12:08 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 9E62620295 for ; Thu, 28 Apr 2016 02:12:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1F6C26EC0E; Thu, 28 Apr 2016 02:12:05 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from smtp-outbound-1.vmware.com (smtp-outbound-1.vmware.com [208.91.2.12]) by gabe.freedesktop.org (Postfix) with ESMTPS id B74AD6EC0E for ; Thu, 28 Apr 2016 02:12:02 +0000 (UTC) Received: from sc9-mailhost1.vmware.com (sc9-mailhost1.vmware.com [10.113.161.71]) by smtp-outbound-1.vmware.com (Postfix) with ESMTP id 5EA2998763 for ; Wed, 27 Apr 2016 19:12:02 -0700 (PDT) Received: from vmware.com (unknown [10.20.88.50]) by sc9-mailhost1.vmware.com (Postfix) with SMTP id 6009C180EB; Wed, 27 Apr 2016 19:12:01 -0700 (PDT) Received: by vmware.com (sSMTP sendmail emulation); Wed, 27 Apr 2016 19:11:19 -0700 From: "Sinclair Yeh" To: dri-devel@lists.freedesktop.org Subject: [PATCH 2/2] drm/vmwgfx: Report vmwgfx version to vmware.log Date: Wed, 27 Apr 2016 19:11:18 -0700 Message-Id: <1461809478-32244-1-git-send-email-syeh@vmware.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Cc: thellstrom@vmware.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 tracking down a customer issue, it is useful to know exactly which version of the vmwgfx they are using. Since vmware.log is often the only available debug log, report vmwgfx version in there. Signed-off-by: Sinclair Yeh Reviewed-by: Thomas Hellstrom --- drivers/gpu/drm/vmwgfx/.gitignore | 2 ++ drivers/gpu/drm/vmwgfx/Makefile | 7 ++++++- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 20 +++++++++++++++++++- drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 6 ++++++ 4 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 drivers/gpu/drm/vmwgfx/.gitignore diff --git a/drivers/gpu/drm/vmwgfx/.gitignore b/drivers/gpu/drm/vmwgfx/.gitignore new file mode 100644 index 0000000..7193109 --- /dev/null +++ b/drivers/gpu/drm/vmwgfx/.gitignore @@ -0,0 +1,2 @@ +vmwgfx_version.h + diff --git a/drivers/gpu/drm/vmwgfx/Makefile b/drivers/gpu/drm/vmwgfx/Makefile index d281575..fd6f47f 100644 --- a/drivers/gpu/drm/vmwgfx/Makefile +++ b/drivers/gpu/drm/vmwgfx/Makefile @@ -8,6 +8,11 @@ vmwgfx-y := vmwgfx_execbuf.o vmwgfx_gmr.o vmwgfx_kms.o vmwgfx_drv.o \ vmwgfx_fence.o vmwgfx_dmabuf.o vmwgfx_scrn.o vmwgfx_context.o \ vmwgfx_surface.o vmwgfx_prime.o vmwgfx_mob.o vmwgfx_shader.o \ vmwgfx_cmdbuf_res.o vmwgfx_cmdbuf.o vmwgfx_stdu.o \ - vmwgfx_cotable.o vmwgfx_so.o vmwgfx_binding.o + vmwgfx_cotable.o vmwgfx_so.o vmwgfx_binding.o vmwgfx_msg.o + +$(obj)/vmwgfx_drv.o: $(src)/vmwgfx_version.h + +$(src)/vmwgfx_version.h: + @echo "#define VMWGFX_GIT_VERSION \""`git rev-parse --short HEAD`"\"" > $(src)/vmwgfx_version.h obj-$(CONFIG_DRM_VMWGFX) := vmwgfx.o diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c index e7335a48..b37f388 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c @@ -1,6 +1,6 @@ /************************************************************************** * - * Copyright © 2009-2015 VMware, Inc., Palo Alto, CA., USA + * Copyright © 2009-2016 VMware, Inc., Palo Alto, CA., USA * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a @@ -35,6 +35,7 @@ #include #include #include +#include "vmwgfx_version.h" #define VMWGFX_DRIVER_NAME "vmwgfx" #define VMWGFX_DRIVER_DESC "Linux drm driver for VMware graphics devices" @@ -44,6 +45,12 @@ #define VMW_MIN_INITIAL_WIDTH 800 #define VMW_MIN_INITIAL_HEIGHT 600 +#ifndef VMWGFX_GIT_VERSION +#define VMWGFX_GIT_VERSION "Unknown" +#endif + +#define VMWGFX_REPO "In Tree" + /** * Fully encoded drm commands. Might move to vmw_drm.h @@ -613,6 +620,7 @@ static int vmw_driver_load(struct drm_device *dev, unsigned long chipset) uint32_t svga_id; enum vmw_res_type i; bool refuse_dma = false; + char host_log[100] = {0}; dev_priv = kzalloc(sizeof(*dev_priv), GFP_KERNEL); if (unlikely(dev_priv == NULL)) { @@ -873,6 +881,16 @@ static int vmw_driver_load(struct drm_device *dev, unsigned long chipset) DRM_INFO("DX: %s\n", dev_priv->has_dx ? "yes." : "no."); + snprintf(host_log, sizeof(host_log), "vmwgfx: %s-%s", + VMWGFX_REPO, VMWGFX_GIT_VERSION); + vmw_host_log(host_log); + + memset(host_log, 0, sizeof(host_log)); + snprintf(host_log, sizeof(host_log), "vmwgfx: Module Version: %d.%d.%d", + VMWGFX_DRIVER_MAJOR, VMWGFX_DRIVER_MINOR, + VMWGFX_DRIVER_PATCHLEVEL); + vmw_host_log(host_log); + if (dev_priv->enable_fb) { vmw_fifo_resource_inc(dev_priv); vmw_svga_enable(dev_priv); diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h index 019a6ca..6715d4a 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h @@ -1234,4 +1234,10 @@ static inline void vmw_mmio_write(u32 value, u32 *addr) { WRITE_ONCE(*addr, value); } + +/** + * Add vmw_msg module function + */ +extern int vmw_host_log(const char *log); + #endif