From patchwork Fri Apr 28 09:10:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: oscar.mateo@intel.com X-Patchwork-Id: 9705045 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B5F54602BE for ; Fri, 28 Apr 2017 16:11:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A5D3228688 for ; Fri, 28 Apr 2017 16:11:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 98E1C28691; Fri, 28 Apr 2017 16:11:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=BAYES_00, DATE_IN_PAST_06_12, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 41AC628688 for ; Fri, 28 Apr 2017 16:11:18 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 97CF16E7D9; Fri, 28 Apr 2017 16:11:17 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id 68F1E6E7D9 for ; Fri, 28 Apr 2017 16:11:17 +0000 (UTC) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga104.jf.intel.com with ESMTP; 28 Apr 2017 09:11:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,388,1488873600"; d="scan'208";a="850930562" Received: from omateolo-linux.fm.intel.com ([10.1.27.118]) by FMSMGA003.fm.intel.com with ESMTP; 28 Apr 2017 09:10:47 -0700 From: Oscar Mateo To: intel-gfx@lists.freedesktop.org Date: Fri, 28 Apr 2017 09:10:47 +0000 Message-Id: <1493370648-14389-1-git-send-email-oscar.mateo@intel.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Cc: Mika Kuoppala Subject: [Intel-gfx] [PATCH 1/2] tools/null_state_gen: Automatically generate the copyright header X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP Last bit to make the generated files directly usable in i915. Cc: Mika Kuoppala Signed-off-by: Oscar Mateo --- tools/null_state_gen/intel_null_state_gen.c | 41 +++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/tools/null_state_gen/intel_null_state_gen.c b/tools/null_state_gen/intel_null_state_gen.c index 7d5887e..06eb954 100644 --- a/tools/null_state_gen/intel_null_state_gen.c +++ b/tools/null_state_gen/intel_null_state_gen.c @@ -29,9 +29,12 @@ #include #include #include +#include #include "intel_renderstate.h" #include "intel_batchbuffer.h" +#include "lib/version.h" +#include "config.h" static int debug = 0; @@ -42,6 +45,42 @@ static void print_usage(char *s) s); } +static void print_copyright(void) +{ + time_t time_raw; + struct tm *time_local; + char year[6]; // avoid the year 10000 effect! + + time(&time_raw); + time_local = localtime(&time_raw); + strftime(year, sizeof(year), "%Y", time_local); + + printf("/*\n"); + printf(" * Copyright © %s Intel Corporation\n", year); + printf(" *\n"); + printf(" * Permission is hereby granted, free of charge, to any person obtaining a\n"); + printf(" * copy of this software and associated documentation files (the \"Software\"),\n"); + printf(" * to deal in the Software without restriction, including without limitation\n"); + printf(" * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n"); + printf(" * and/or sell copies of the Software, and to permit persons to whom the\n"); + printf(" * Software is furnished to do so, subject to the following conditions:\n"); + printf(" *\n"); + printf(" * The above copyright notice and this permission notice (including the next\n"); + printf(" * paragraph) shall be included in all copies or substantial portions of the\n"); + printf(" * Software.\n"); + printf(" *\n"); + printf(" * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n"); + printf(" * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n"); + printf(" * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n"); + printf(" * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n"); + printf(" * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n"); + printf(" * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n"); + printf(" * DEALINGS IN THE SOFTWARE.\n"); + printf(" *\n"); + printf(" * Generated by: intel-gpu-tools-%s-%s\n", PACKAGE_VERSION, IGT_GIT_SHA1); + printf(" */\n\n"); +} + /* Creates the intel_renderstate_genX.c file for the particular * GEN product */ @@ -52,6 +91,8 @@ static int print_state(int gen, struct intel_batchbuffer *batch) fprintf(stderr, "Generating for gen%d\n", gen); + print_copyright(); + printf("#include \"intel_renderstate.h\"\n\n"); /* Relocation offsets. These are byte offsets in the golden context