接前一篇文章:DRM遇到的实际问题及领悟(1)
三、进一步定位
上回说到使用网上例程有同样会遇到mmap错误的问题,对于这个错误,perror只给出了“Invalid argument”的错误原因,具体错在哪里,并不知道。
1. 源码准备
没有办法,只能再找一个能够成功的例程。功夫不负有心人,在网上不断搜索,最终找到了以下链接中的例程:
https://github.com/tiagovignatti/intel-gpu-tools/blob/master/tools/intel_framebuffer_dump.c
代码如下:
/*
* Copyright © 2013 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person ob