<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="generator" content="HTML Tidy for Windows (vers 25 March 2009), see www.w3.org">
<meta name="Generator" content="MS Exchange Server version 14.03.0123.002">
<title>Re: [Beignet] [PATCH V2] gbe_bin_generater: fix two bugs.</title>
</head>
<body>
How about searching for bdf "00:02.0"?<br>
<br>
-----Original Message-----<br>
<b>From: </b>Yang, Rong R [<a href="mailto:rong.r.yang@intel.com">rong.r.yang@intel.com</a>]<br>
<b>Sent: </b>Monday, May 26, 2014 01:58 AM Pacific Standard Time<br>
<b>To: </b>He Junyan; Gong, Zhigang<br>
<b>Cc: </b>Zhigang Gong; beignet@lists.freedesktop.org<br>
<b>Subject: </b>Re: [Beignet] [PATCH V2] gbe_bin_generater: fix two bugs.<br>
<br>
<!-- Converted from text/plain format -->
<p><font size="2">How about retry if get empty pci id.<br>
<br>
For example:<br>
lspci -nn | grep " VGA.*Gen .* Graphics" -i | grep "\[8086:.*\]" -o | awk -F : '{print $2}' | awk -F ] '{print $1}'<br>
if [ -z "$1" ]; then<br>
lspci -nn | grep " VGA.*Intel .* Graphics" -i | grep "\[8086:.*\]" -o | awk -F : '{print $2}' | awk -F ] '{print $1}'<br>
fi<br>
if [ -z "$1" ]; then<br>
lspci -nn | grep " VGA.* Graphics.*8086" -i | grep "\[8086:.*\]" -o | awk -F : '{print $2}' | awk -F ] '{print $1}'<br>
fi<br>
-----Original Message-----<br>
From: Beignet [<a href="mailto:beignet-bounces@lists.freedesktop.org">mailto:beignet-bounces@lists.freedesktop.org</a>] On Behalf Of He Junyan<br>
Sent: Friday, May 23, 2014 11:14 PM<br>
To: Gong, Zhigang<br>
Cc: Zhigang Gong; beignet@lists.freedesktop.org<br>
Subject: Re: [Beignet] [PATCH V2] gbe_bin_generater: fix two bugs.<br>
<br>
Some PCI ID do not have Gen keyword, such as ruiling's IVBridge XXXXXX So need to refine the command line<br>
<br>
On Fri, 2014-05-23 at 19:04 +0800, Zhigang Gong wrote:<br>
> From: Zhigang Gong <zhigang.gong@linux.intel.com><br>
><br>
> The pci id detecting method is broken on some system.<br>
> And the gen pci id parsing in gbe_bin_generater is incorrect when the<br>
> pci id has a-f hex digit.<br>
><br>
> v2:<br>
> Add VGA to filter out some nonVGA devices.<br>
> Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com><br>
> ---<br>
> backend/src/gbe_bin_generater.cpp | 7 +++++--<br>
> src/GetGenID.sh | 2 +-<br>
> 2 files changed, 6 insertions(+), 3 deletions(-)<br>
><br>
> diff --git a/backend/src/gbe_bin_generater.cpp<br>
> b/backend/src/gbe_bin_generater.cpp<br>
> index 50020b5..898e2f2 100644<br>
> --- a/backend/src/gbe_bin_generater.cpp<br>
> +++ b/backend/src/gbe_bin_generater.cpp<br>
> @@ -34,6 +34,7 @@<br>
> #include <vector><br>
> #include <algorithm><br>
> #include <stdlib.h><br>
> +#include <iostream><br>
> #include <stdio.h><br>
> <br>
> #include "backend/program.h"<br>
> @@ -46,7 +47,7 @@ using namespace std; #define FILE_BUILD_FAILED 3 <br>
> #define FILE_SERIALIZATION_FAILED 4<br>
> <br>
> -static int gen_pci_id = 0;<br>
> +static uint32_t gen_pci_id = 0;<br>
> <br>
> class program_build_instance {<br>
> <br>
> @@ -296,7 +297,9 @@ int main (int argc, const char **argv)<br>
> return 1;<br>
> }<br>
> <br>
> - gen_pci_id = (s[0] - '0') << 12 | (s[1] - '0') << 8 | (s[2] - '0') << 4 | (s[3] - '0');<br>
> + std::stringstream str(s);<br>
> + str >> std::hex >> gen_pci_id;<br>
> +<br>
> used_index[optind-1] = 1;<br>
> // We must set the image base index here, as we invoke the backend in a non-standard way.<br>
> gbe_set_image_base_index(3); diff --git a/src/GetGenID.sh<br>
> b/src/GetGenID.sh index 3114bd8..f8cb0a7 100755<br>
> --- a/src/GetGenID.sh<br>
> +++ b/src/GetGenID.sh<br>
> @@ -1,2 +1,2 @@<br>
> #!/bin/bash<br>
> -lspci -nn | grep "Gen .* Graphics" -i | grep "\[8086:.*\]" -o | awk -F : '{print $2}' | awk -F ] '{print $1}'<br>
> +lspci -nn | grep "VGA.*Gen.*\[8086:" -i | grep "\[8086:.*\]" -o | awk -F : '{print $2}' | awk -F ] '{print $1}'<br>
<br>
<br>
<br>
_______________________________________________<br>
Beignet mailing list<br>
Beignet@lists.freedesktop.org<br>
<a href="http://lists.freedesktop.org/mailman/listinfo/beignet">http://lists.freedesktop.org/mailman/listinfo/beignet</a><br>
_______________________________________________<br>
Beignet mailing list<br>
Beignet@lists.freedesktop.org<br>
<a href="http://lists.freedesktop.org/mailman/listinfo/beignet">http://lists.freedesktop.org/mailman/listinfo/beignet</a><br>
</font></p>
</body>
</html>