summaryrefslogtreecommitdiffstats
path: root/scilab/modules/graphics/etc/intel_bug_7526.sce
blob: 01e6085254f9d2832693ec98549f671829ac32fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
// Copyright (C) 2011 - DIGITEO - Allan CORNET
//
// This file must be used under the terms of the CeCILL.
// This source file is licensed as described in the file COPYING, which
// you should have received as part of this distribution.  The terms
// are also available at
// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt

// quick way to detect bug 7526

function detect_bug_7526()

  function WarningDriversIntel()
    msg = ["Old Intel(R) HD Graphics drivers detected (bug #7526).";
           "Please update your video drivers:";
           "http://downloadcenter.intel.com/Detail_Desc.aspx?lang=eng&changeLang=true&DwnldId=19758"];
    warning(msg);
  endfunction

  function bOK = isIntelHD()
    bOK = %f;
    [dyninfo, statinfo] = getdebuginfo();
    videocard = dyninfo(grep(dyninfo, "Video card:"));
    videocard = strsubst(videocard, "Video card:", "");
    bOK = grep(stripblanks(convstr(videocard, "u")), "INTEL(R) HD GRAPHICS") <> [];
  endfunction
  
  function bOK = isOldIntelHDDrivers()
    
    bOK = %f;
    [dyninfo, statinfo] = getdebuginfo();
    driversvideocard = dyninfo(grep(dyninfo, "Video card driver version:"));
    driversvideocard = strsubst(driversvideocard, "Video card driver version:", "");
    ierr = execstr("[nbparams, driverVer1, driverVer2, driverVer3, driverVer4] = msscanf(driversvideocard, ""%d.%d.%d.%d"");", "errcatch");
    if  ierr == 0 then
     // revision < to 2279 does not work
     if driverVer4 < 2279 then 
       bOK = %t;
     end
    end
  endfunction

  if getos() == "Windows" then
    if isIntelHD() & isOldIntelHDDrivers() then
      WarningDriversIntel();
    end
  end
endfunction

detect_bug_7526();
clear detect_bug_7526;