2005-04-16 15:20:36 -07:00
|
|
|
|
2014-08-29 12:12:40 +02:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2010-05-27 13:40:25 -06:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2014-08-29 12:12:40 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-08-29 12:12:37 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
drm: provide device-refcount
Lets not trick ourselves into thinking "drm_device" objects are not
ref-counted. That's just utterly stupid. We manage "drm_minor" objects on
each drm-device and each minor can have an unlimited number of open
handles. Each of these handles has the drm_minor (and thus the drm_device)
as private-data in the file-handle. Therefore, we may not destroy
"drm_device" until all these handles are closed.
It is *not* possible to reset all these pointers atomically and restrict
access to them, and this is *not* how this is done! Instead, we use
ref-counts to make sure the object is valid and not freed.
Note that we currently use "dev->open_count" for that, which is *exactly*
the same as a reference-count, just open coded. So this patch doesn't
change any semantics on DRM devices (well, this patch just introduces the
ref-count, anyway. Follow-up patches will replace open_count by it).
Also note that generic VFS revoke support could allow us to drop this
ref-count again. We could then just synchronously disable any fops->xy()
calls. However, this is not the case, yet, and no such patches are
in sight (and I seriously question the idea of dropping the ref-cnt
again).
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2014-01-29 10:21:36 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2006-02-02 19:37:46 +11:00
|
|
|
|
2014-08-29 12:12:37 +02:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2014-08-29 12:12:37 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-08-29 12:12:35 +02:00
|
|
|
|
2014-08-29 12:12:37 +02:00
|
|
|
|
2016-10-25 13:00:45 +01:00
|
|
|
|
2017-03-08 15:12:35 +01:00
|
|
|
|
2014-08-29 12:12:37 +02:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2016-12-24 11:46:01 -08:00
|
|
|
|
2014-08-29 12:12:37 +02:00
|
|
|
|
2014-08-29 12:12:40 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-06-09 12:54:08 +03:00
|
|
|
|
2014-08-29 12:12:40 +02:00
|
|
|
|
2014-08-29 12:12:37 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-02 18:01:03 +01:00
|
|
|
|
2016-11-14 12:58:19 +01:00
|
|
|
|
2017-03-08 15:12:35 +01:00
|
|
|
|
2017-03-08 15:12:37 +01:00
|
|
|
|
2017-03-08 15:12:42 +01:00
|
|
|
|
2017-03-22 21:53:36 +01:00
|
|
|
|
2017-03-22 21:54:47 +01:00
|
|
|
|
2017-04-04 11:52:55 +02:00
|
|
|
|
2017-05-31 11:21:46 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2011-05-26 13:46:22 -04:00
|
|
|
|
|
|
|
|
|
2007-09-03 12:06:45 +10:00
|
|
|
|
2014-08-29 12:12:32 +02:00
|
|
|
|
2014-09-11 07:43:25 +02:00
|
|
|
|
|
|
|
|
|
2014-09-23 15:46:53 +02:00
|
|
|
|
2016-06-21 10:54:22 +02:00
|
|
|
|
2016-07-15 21:48:01 +02:00
|
|
|
|
2017-03-08 15:12:35 +01:00
|
|
|
|
2007-09-03 12:06:45 +10:00
|
|
|
|
2012-10-28 18:28:06 +01:00
|
|
|
|
2012-11-14 11:22:52 +01:00
|
|
|
|
2014-07-01 12:57:26 +02:00
|
|
|
|
2014-01-09 11:03:14 +01:00
|
|
|
|
2012-11-14 11:22:52 +01:00
|
|
|
|
2017-03-08 15:12:37 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-03-24 15:53:08 +00:00
|
|
|
|
2016-04-14 10:34:16 -04:00
|
|
|
|
2014-03-24 15:53:08 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-22 12:24:16 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-10-09 22:57:37 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-03-24 15:53:08 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-10-09 22:57:37 +03:00
|
|
|
|
2014-03-24 15:53:08 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-08-15 16:18:04 -07:00
|
|
|
|
drm: add separate drm debugging levels
Now all the DRM debug info will be reported if the boot option of
"drm.debug=1" is added. Sometimes it is inconvenient to get the debug
info in KMS mode. We will get too much unrelated info.
This will separate several DRM debug levels and the debug level can be used
to print the different debug info. And the debug level is controlled by the
module parameter of drm.debug
In this patch it is divided into four debug levels;
drm_core, drm_driver, drm_kms, drm_mode.
At the same time we can get the different debug info by changing the debug
level. This can be done by adding the module parameter. Of course it can
be changed through the /sys/module/drm/parameters/debug after the system is
booted.
Four debug macro definitions are provided.
DRM_DEBUG(fmt, args...)
DRM_DEBUG_DRIVER(prefix, fmt, args...)
DRM_DEBUG_KMS(prefix, fmt, args...)
DRM_DEBUG_MODE(prefix, fmt, args...)
When the boot option of "drm.debug=4" is added, it will print the debug info
using DRM_DEBUG_KMS macro definition.
When the boot option of "drm.debug=6" is added, it will print the debug info
using DRM_DEBUG_KMS/DRM_DEBUG_DRIVER.
Sometimes we expect to print the value of an array.
For example: SDVO command,
In such case the following four DRM debug macro definitions are added:
DRM_LOG(fmt, args...)
DRM_LOG_DRIVER(fmt, args...)
DRM_LOG_KMS(fmt, args...)
DRM_LOG_MODE(fmt, args...)
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-06-02 14:09:47 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-11-25 15:21:02 +00:00
|
|
|
|
2015-02-22 12:24:16 +01:00
|
|
|
|
2015-10-09 22:57:37 +03:00
|
|
|
|
2016-11-05 11:08:09 -04:00
|
|
|
|
drm: add separate drm debugging levels
Now all the DRM debug info will be reported if the boot option of
"drm.debug=1" is added. Sometimes it is inconvenient to get the debug
info in KMS mode. We will get too much unrelated info.
This will separate several DRM debug levels and the debug level can be used
to print the different debug info. And the debug level is controlled by the
module parameter of drm.debug
In this patch it is divided into four debug levels;
drm_core, drm_driver, drm_kms, drm_mode.
At the same time we can get the different debug info by changing the debug
level. This can be done by adding the module parameter. Of course it can
be changed through the /sys/module/drm/parameters/debug after the system is
booted.
Four debug macro definitions are provided.
DRM_DEBUG(fmt, args...)
DRM_DEBUG_DRIVER(prefix, fmt, args...)
DRM_DEBUG_KMS(prefix, fmt, args...)
DRM_DEBUG_MODE(prefix, fmt, args...)
When the boot option of "drm.debug=4" is added, it will print the debug info
using DRM_DEBUG_KMS macro definition.
When the boot option of "drm.debug=6" is added, it will print the debug info
using DRM_DEBUG_KMS/DRM_DEBUG_DRIVER.
Sometimes we expect to print the value of an array.
For example: SDVO command,
In such case the following four DRM debug macro definitions are added:
DRM_LOG(fmt, args...)
DRM_LOG_DRIVER(fmt, args...)
DRM_LOG_KMS(fmt, args...)
DRM_LOG_MODE(fmt, args...)
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-06-02 14:09:47 +08:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-08-18 18:17:22 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-08-15 16:18:04 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-09-25 19:18:34 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2013-11-21 14:29:51 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-08-15 16:18:04 -07:00
|
|
|
|
2013-11-21 14:29:51 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-08-15 16:18:04 -07:00
|
|
|
|
2013-11-21 14:29:51 -05:00
|
|
|
|
2016-08-15 16:18:04 -07:00
|
|
|
|
|
|
|
|
|
2013-11-21 14:29:51 -05:00
|
|
|
|
2016-08-15 16:18:04 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2016-08-15 16:18:04 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-01-31 15:49:07 +02:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2005-09-25 14:28:13 +10:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-08-15 16:18:04 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-09-25 19:18:34 -07:00
|
|
|
|
|
|
|
|
|
drm: add separate drm debugging levels
Now all the DRM debug info will be reported if the boot option of
"drm.debug=1" is added. Sometimes it is inconvenient to get the debug
info in KMS mode. We will get too much unrelated info.
This will separate several DRM debug levels and the debug level can be used
to print the different debug info. And the debug level is controlled by the
module parameter of drm.debug
In this patch it is divided into four debug levels;
drm_core, drm_driver, drm_kms, drm_mode.
At the same time we can get the different debug info by changing the debug
level. This can be done by adding the module parameter. Of course it can
be changed through the /sys/module/drm/parameters/debug after the system is
booted.
Four debug macro definitions are provided.
DRM_DEBUG(fmt, args...)
DRM_DEBUG_DRIVER(prefix, fmt, args...)
DRM_DEBUG_KMS(prefix, fmt, args...)
DRM_DEBUG_MODE(prefix, fmt, args...)
When the boot option of "drm.debug=4" is added, it will print the debug info
using DRM_DEBUG_KMS macro definition.
When the boot option of "drm.debug=6" is added, it will print the debug info
using DRM_DEBUG_KMS/DRM_DEBUG_DRIVER.
Sometimes we expect to print the value of an array.
For example: SDVO command,
In such case the following four DRM debug macro definitions are added:
DRM_LOG(fmt, args...)
DRM_LOG_DRIVER(fmt, args...)
DRM_LOG_KMS(fmt, args...)
DRM_LOG_MODE(fmt, args...)
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-06-02 14:09:47 +08:00
|
|
|
|
2016-08-15 16:18:04 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-09-25 19:18:34 -07:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2016-08-15 16:18:04 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-09-25 19:18:34 -07:00
|
|
|
|
|
|
|
|
|
2016-08-15 16:18:04 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-09-25 19:18:34 -07:00
|
|
|
|
|
|
|
|
|
2016-08-15 16:18:04 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-09-25 19:18:34 -07:00
|
|
|
|
|
|
|
|
|
2016-08-15 16:18:04 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-09-25 19:18:34 -07:00
|
|
|
|
|
|
|
|
|
2016-08-15 16:18:04 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-08-05 20:30:38 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-08-15 16:18:04 -07:00
|
|
|
|
|
|
|
|
|
2016-08-05 20:30:38 -04:00
|
|
|
|
2016-08-15 16:18:04 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-08-05 20:30:38 -04:00
|
|
|
|
2016-08-15 16:18:04 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-08-05 20:30:38 -04:00
|
|
|
|
2016-08-15 16:18:04 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-08-05 20:30:38 -04:00
|
|
|
|
2016-08-15 16:18:04 -07:00
|
|
|
|
2016-08-05 20:30:38 -04:00
|
|
|
|
2016-11-05 11:08:06 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-07-11 15:53:27 +10:00
|
|
|
|
2013-12-11 11:34:31 +01:00
|
|
|
|
2005-09-25 14:28:13 +10:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2014-01-28 16:00:35 +01:00
|
|
|
|
|
|
|
|
|
drm: provide device-refcount
Lets not trick ourselves into thinking "drm_device" objects are not
ref-counted. That's just utterly stupid. We manage "drm_minor" objects on
each drm-device and each minor can have an unlimited number of open
handles. Each of these handles has the drm_minor (and thus the drm_device)
as private-data in the file-handle. Therefore, we may not destroy
"drm_device" until all these handles are closed.
It is *not* possible to reset all these pointers atomically and restrict
access to them, and this is *not* how this is done! Instead, we use
ref-counts to make sure the object is valid and not freed.
Note that we currently use "dev->open_count" for that, which is *exactly*
the same as a reference-count, just open coded. So this patch doesn't
change any semantics on DRM devices (well, this patch just introduces the
ref-count, anyway. Follow-up patches will replace open_count by it).
Also note that generic VFS revoke support could allow us to drop this
ref-count again. We could then just synchronously disable any fops->xy()
calls. However, this is not the case, yet, and no such patches are
in sight (and I seriously question the idea of dropping the ref-cnt
again).
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2014-01-29 10:21:36 +01:00
|
|
|
|
2014-01-28 16:00:35 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-12 17:15:56 +01:00
|
|
|
|
2016-06-21 10:54:12 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-01-28 16:00:35 +01:00
|
|
|
|
2014-03-16 13:13:51 +01:00
|
|
|
|
2014-04-11 15:23:00 +02:00
|
|
|
|
2014-01-28 16:00:35 +01:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2005-09-25 14:28:13 +10:00
|
|
|
|
2006-02-02 19:37:46 +11:00
|
|
|
|
2014-02-25 19:57:44 +01:00
|
|
|
|
2005-09-25 14:28:13 +10:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2005-09-25 14:28:13 +10:00
|
|
|
|
2013-11-03 20:46:34 +01:00
|
|
|
|
2013-12-16 11:21:06 +01:00
|
|
|
|
2005-09-25 14:28:13 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2016-04-26 19:29:41 +02:00
|
|
|
|
2007-05-26 05:01:51 +10:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2005-09-25 14:28:13 +10:00
|
|
|
|
2007-05-26 05:01:51 +10:00
|
|
|
|
2007-07-12 10:26:44 +10:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2005-09-25 14:28:13 +10:00
|
|
|
|
2007-05-26 05:01:51 +10:00
|
|
|
|
2006-02-02 19:37:46 +11:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2007-07-17 10:46:52 +10:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2007-05-26 05:01:51 +10:00
|
|
|
|
2008-11-07 14:05:41 -08:00
|
|
|
|
2005-09-25 14:28:13 +10:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2011-10-26 00:54:41 +02:00
|
|
|
|
2005-09-25 14:28:13 +10:00
|
|
|
|
2007-07-11 16:32:08 +10:00
|
|
|
|
2005-09-25 14:28:13 +10:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2005-09-25 14:28:13 +10:00
|
|
|
|
2013-12-16 11:21:15 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2005-09-25 14:28:13 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-05-31 11:22:53 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-12-17 16:41:41 +01:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2014-08-06 14:49:54 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-10-04 14:53:36 +03:00
|
|
|
|
|
|
|
|
|
2008-09-30 12:14:26 -07:00
|
|
|
|
drm/vblank: Add support for precise vblank timestamping.
The DRI2 swap & sync implementation needs precise
vblank counts and precise timestamps corresponding
to those vblank counts. For conformance to the OpenML
OML_sync_control extension specification the DRM
timestamp associated with a vblank count should
correspond to the start of video scanout of the first
scanline of the video frame following the vblank
interval for that vblank count.
Therefore we need to carry around precise timestamps
for vblanks. Currently the DRM and KMS drivers generate
timestamps ad-hoc via do_gettimeofday() in some
places. The resulting timestamps are sometimes not
very precise due to interrupt handling delays, they
don't conform to OML_sync_control and some are wrong,
as they aren't taken synchronized to the vblank.
This patch implements support inside the drm core
for precise and robust timestamping. It consists
of the following interrelated pieces.
1. Vblank timestamp caching:
A per-crtc ringbuffer stores the most recent vblank
timestamps corresponding to vblank counts.
The ringbuffer can be read out lock-free via the
accessor function:
struct timeval timestamp;
vblankcount = drm_vblank_count_and_time(dev, crtcid, ×tamp).
The function returns the current vblank count and
the corresponding timestamp for start of video
scanout following the vblank interval. It can be
used anywhere between enclosing drm_vblank_get(dev, crtcid)
and drm_vblank_put(dev,crtcid) statements. It is used
inside the drmWaitVblank ioctl and in the vblank event
queueing and handling. It should be used by kms drivers for
timestamping of bufferswap completion.
The timestamp ringbuffer is reinitialized each time
vblank irq's get reenabled in drm_vblank_get()/
drm_update_vblank_count(). It is invalidated when
vblank irq's get disabled.
The ringbuffer is updated inside drm_handle_vblank()
at each vblank irq.
2. Calculation of precise vblank timestamps:
drm_get_last_vbltimestamp() is used to compute the
timestamp for the end of the most recent vblank (if
inside active scanout), or the expected end of the
current vblank interval (if called inside a vblank
interval). The function calls into a new optional kms
driver entry point dev->driver->get_vblank_timestamp()
which is supposed to provide the precise timestamp.
If a kms driver doesn't implement the entry point or
if the call fails, a simple do_gettimeofday() timestamp
is returned as crude approximation of the true vblank time.
A new drm module parameter drm.timestamp_precision_usec
allows to disable high precision timestamps (if set to
zero) or to specify the maximum acceptable error in
the timestamps in microseconds.
Kms drivers could implement their get_vblank_timestamp()
function in a gpu specific way, as long as returned
timestamps conform to OML_sync_control, e.g., by use
of gpu specific hardware timestamps.
Optionally, kms drivers can simply wrap and use the new
utility function drm_calc_vbltimestamp_from_scanoutpos().
This function calls a new optional kms driver function
dev->driver->get_scanout_position() which returns the
current horizontal and vertical video scanout position
of the crtc. The scanout position together with the
drm_display_timing of the current video mode is used
to calculate elapsed time relative to start of active scanout
for the current video frame. This elapsed time is subtracted
from the current do_gettimeofday() time to get the timestamp
corresponding to start of video scanout. Currently
non-interlaced, non-doublescan video modes, with or
without panel scaling are handled correctly. Interlaced/
doublescan modes are tbd in a future patch.
3. Filtering of redundant vblank irq's and removal of
some race-conditions in the vblank irq enable/disable path:
Some gpu's (e.g., Radeon R500/R600) send spurious vblank
irq's outside the vblank if vblank irq's get reenabled.
These get detected by use of the vblank timestamps and
filtered out to avoid miscounting of vblanks.
Some race-conditions between the vblank irq enable/disable
functions, the vblank irq handler and the gpu itself (updating
its hardware vblank counter in the "wrong" moment) are
fixed inside vblank_disable_and_save() and
drm_update_vblank_count() by use of the vblank timestamps and
a new spinlock dev->vblank_time_lock.
The time until vblank irq disable is now configurable via
a new drm module parameter drm.vblankoffdelay to allow
experimentation with timeouts that are much shorter than
the current 5 seconds and should allow longer vblank off
periods for better power savings.
Followup patches will use these new functions to
implement precise timestamping for the intel and radeon
kms drivers.
Signed-off-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-10-23 04:20:23 +02:00
|
|
|
|
2005-09-25 14:28:13 +10:00
|
|
|
|
2008-09-30 12:14:26 -07:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2009-09-12 04:33:34 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-09-25 14:28:13 +10:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2007-07-11 16:53:40 +10:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2005-09-25 14:28:13 +10:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-05-27 13:40:25 -06:00
|
|
|
|
2007-07-11 16:53:40 +10:00
|
|
|
|
2011-02-24 08:35:06 +10:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2014-08-29 12:12:39 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-02-02 16:55:46 +11:00
|
|
|
|
2005-08-05 22:11:22 +10:00
|
|
|
|
2006-10-24 23:04:19 +10:00
|
|
|
|
2014-11-25 20:33:10 -05:00
|
|
|
|
2008-11-07 14:05:41 -08:00
|
|
|
|
2008-07-30 12:06:12 -07:00
|
|
|
|
|
|
|
|
|
2013-08-15 00:02:44 +02:00
|
|
|
|
2008-07-30 12:06:12 -07:00
|
|
|
|
2013-12-11 14:24:46 +01:00
|
|
|
|
2008-07-30 12:06:12 -07:00
|
|
|
|
2010-12-07 09:20:40 +10:00
|
|
|
|
2007-07-11 15:53:27 +10:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2016-12-22 00:50:42 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-12-07 09:20:40 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-09-12 15:55:05 +10:00
|
|
|
|
2010-12-07 09:20:40 +10:00
|
|
|
|
2005-09-25 14:28:13 +10:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-02-20 14:18:07 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-03-23 13:28:33 +11:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-12-15 03:16:38 +10:00
|
|
|
|
|
|
|
|
|
2012-01-05 09:55:22 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
drm: fix potential dangling else problems in for_each_ macros
We have serious dangling else bugs waiting to happen in our for_each_
style macros with ifs. Consider, for example,
#define drm_for_each_plane_mask(plane, dev, plane_mask) \
list_for_each_entry((plane), &(dev)->mode_config.plane_list, head) \
if ((plane_mask) & (1 << drm_plane_index(plane)))
If this is used in context:
if (condition)
drm_for_each_plane_mask(plane, dev, plane_mask);
else
foo();
foo() will be called for each plane *not* in plane_mask, if condition
holds, and not at all if condition doesn't hold.
Fix this by reversing the conditions in the macros, and adding an else
branch for the "for each" block, so that other if/else blocks can't
interfere. Provide a "for_each_if" helper macro to make it easier to get
this right.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1448392916-2281-1-git-send-email-jani.nikula@intel.com
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-11-24 21:21:55 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|