From patchwork Thu Jun 15 07:42:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 9788249 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 DDF9160384 for ; Thu, 15 Jun 2017 07:42:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D086A28419 for ; Thu, 15 Jun 2017 07:42:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C534F284ED; Thu, 15 Jun 2017 07:42:23 +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=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID 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 7217328419 for ; Thu, 15 Jun 2017 07:42:21 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BEDC16E6B3; Thu, 15 Jun 2017 07:42:19 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr0-x243.google.com (mail-wr0-x243.google.com [IPv6:2a00:1450:400c:c0c::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id 56E966E6A7; Thu, 15 Jun 2017 07:42:18 +0000 (UTC) Received: by mail-wr0-x243.google.com with SMTP id z45so1617004wrb.2; Thu, 15 Jun 2017 00:42:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=KDqDmzeyy4yKACv33PLE0pXe0yib3YxqwRYLRGnMiw4=; b=glpGbAoAqYVbFgozuApv3IRx2YbGzWvxdCMGWM/WnBBaa9oTTkXW3TNH4b0XKbWt8i AtttFhlsbN3PTTe9zmPE61KLiARtpIyhFq4JQLY8JyB2qGBSx7HdLwgTW7ZIeDK4U5Oo jJWk4JIDLZJXZ+A3gD4CBUhB5bLs34WhWHVwy/+PLCzf/NYdgBTBcVggf9mWIt76brZ/ 3zeq9Dd9TiDuQ6NSCSLUJ9+I1Xvv6rRZLzufAdW5n2ifaeu/v2XK5iA8rrbx/DZ0dBAr QM7kAEltSK/9gtrr/QTju47MuOQTro7qBG+wmNYSYOONgR2thfPeBNTbcKf9GiUygS1b zu2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=KDqDmzeyy4yKACv33PLE0pXe0yib3YxqwRYLRGnMiw4=; b=VqIFfq9sztojawnYsIsW2P9r0cV9/wYVZMFUkSW9FOwYx7aS6xWF+UcQyACPCJD/zD iwAINr9vmg/8zITdrk524TBFHUZ7Xom5CsQVeAvkP8Ij+KrTj33y4sHa4sHonv4hXYBw Vo/IOUw3r8GVv1Z9y3dtNfB14fO/9tyq62LRb2YNCHo+zSmp7rkWQ7B+fuK10IhXFmMN k/8htiZZUaJ2Zv6OtFhrej1q1Jl0JEkeIY1J4S+9FBQ+l6pWLZ6wEBpUHPGJ0G1fvzA6 U3RfQCzKmOdeCGntPFadltWIiVx+/VhX/TlHOLy5AQHmxhKYJ4YMa65/kNbF+5ezIeSb ekYg== X-Gm-Message-State: AKS2vOzLYAFk9OKSE5sloZ94TTWGdQL66GJK3rvTCPoPrciWR1Zp2btm aibfFBT5Bp+YMm0QODZa7aKS0mqPbJZj X-Received: by 10.28.4.21 with SMTP id 21mr2585914wme.24.1497512536872; Thu, 15 Jun 2017 00:42:16 -0700 (PDT) MIME-Version: 1.0 Received: by 10.28.96.213 with HTTP; Thu, 15 Jun 2017 00:42:15 -0700 (PDT) In-Reply-To: References: <20170612095021.5711-1-michel@daenzer.net> <20170613094555.29998-1-michel@daenzer.net> From: Emil Velikov Date: Thu, 15 Jun 2017 08:42:15 +0100 Message-ID: Subject: Re: [PATCH libdrm v8] amdgpu: move asic id table to a separate file To: =?UTF-8?Q?Michel_D=C3=A4nzer?= Cc: amd-gfx mailing list , ML dri-devel 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-Virus-Scanned: ClamAV using ClamSMTP On 15 June 2017 at 04:16, Michel Dänzer wrote: > On 14/06/17 08:34 PM, Emil Velikov wrote: >> On 13 June 2017 at 10:45, Michel Dänzer wrote: >>> From: Xiaojie Yuan >>> >>> v2: fix an off by one error and leading white spaces >>> v3: use thread safe strtok_r(); initialize len before calling getline(); >>> change printf() to drmMsg(); add initial amdgpu.ids >>> v4: integrate some recent internal changes, including format changes >>> v5: fix line number for empty/commented lines; realloc to save memory; >>> indentation changes >>> v6: remove a line error >>> v7: [Michel Dänzer] >>> * Move amdgpu.ids to new data directory >>> * Remove placeholder entries from amdgpu.ids >>> * Set libdrmdatadir variable in configure.ac instead of Makefile.am >>> [Emil Velikov] >>> * Use isblank() instead of open-coding it [Emil Velikov] >>> * Don't leak asic_id_table memory if realloc fails [Emil Velikov] >>> * Check and bump table_max_size at the beginning of the while loop [Emil >>> Velikov] >>> * Initialize table_max_size to the number of entries in data/amdgpu.ids >> Thank you for addressing some of my suggestions. >> Reviewed-by: Emil Velikov > > Thanks! Pushed. > > >> Personally I would not have bothered with the table_max_size thing > > It seemed silly to reallocate the memory in the default case where the > amdgpu.ids file from this repository is used. :) > Agreed. Yet the single, "reduce memory consumption" realloc seems to diminish amongst the ~150 [unneeded] strdup/free, in parse_one_line >> or the separate Makefile. > > You mean data/Makefile.am? What would you have done instead? > One can fold the two lines within the top makefile (see below) since I'm lazy to complete the "use non-recursive makefiles" [1] branch. -Emil [1] https://github.com/evelikov/libdrm/commits/hello-world dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel --- a/Makefile.am +++ b/Makefile.am @@ -43,6 +43,9 @@ AM_DISTCHECK_CONFIGURE_FLAGS = \ --enable-manpages \ --enable-valgrind +libdrmdatadir = @libdrmdatadir@ +dist_libdrmdata_DATA = data/amdgpu.ids + pkgconfigdir = @pkgconfigdir@ pkgconfig_DATA = libdrm.pc _______________________________________________