Skip to content

Instantly share code, notes, and snippets.

View zcwang's full-sized avatar

Gary Wang zcwang

View GitHub Profile
@Brainiarc7
Brainiarc7 / ffmpeg-vp8&9-encode-test-vaapi-intel.md
Last active December 31, 2023 02:19
PSA: You can now use FFmpeg's VAAPI-based VP8 and VP9 encoder on Skylake+ systems on Linux: Tested on Ubuntu 16.04LTS

Build VAAPI with support for VP8/9 decode and encode hardware acceleration on a Skylake validation testbed:

Build platform: Ubuntu 16.04LTS.

First things first:

Install baseline dependencies first

sudo apt-get -y install autoconf automake build-essential libass-dev libtool pkg-config texinfo zlib1g-dev libva-dev cmake mercurial libdrm-dev libvorbis-dev libogg-dev git libx11-dev libperl-dev libpciaccess-dev libpciaccess0 xorg-dev intel-gpu-tools

@wmealing
wmealing / C-states.md
Last active March 29, 2024 22:51
What are CPU "C-states" and how to disable them if needed?

To limit a CPU to a certain C-state, you can pass the processor.max_cstate=X option in the kernel line of /boot/grub/grub.conf.

Here we limit the system to only C-State 1:

    kernel /vmlinuz-2.6.18-371.1.2.el5 ... processor.max_cstate=1

On some systems, the kernel can override the BIOS setting, and the parameter intel_idle.max_cstate=0 may be required to ensure sleep states are not entered:

@tiagovignatti
tiagovignatti / gist:23bb659d3a59029cdc23
Created July 4, 2014 14:44
hack for starting secondary display
commit 3c1bdd234926334b36f68a2a522044eee5a80066
Author: Tiago Vignatti <tiago.vignatti@intel.com>
Date: Thu Jul 3 16:32:09 2014 -0300
hack for starting secondary display
diff --git a/ui/ozone/platform/dri/screen_manager.cc b/ui/ozone/platform/dri/screen_manager.cc
index ada162d..6fbf94c 100644
--- a/ui/ozone/platform/dri/screen_manager.cc
+++ b/ui/ozone/platform/dri/screen_manager.cc
#include <cstdio>
#include <algorithm>
#include <cmath>
using namespace std;
struct point_type{
double x;
double y;
};
bool cmp(point_type a,point_type b)
{