drm: Used DRM_LEGACY for all legacy functions

Except for nouveau, only legacy drivers need this really. And nouveau
is already marked up with DRIVER_KMS_LEGACY_CONTEXT as the special
case.

I've tried to be careful to leave everything related to modeset still
using the DRIVER_MODESET flag. Otherwise it's a direct replacement of
!DRIVER_MODESET with DRIVER_LEGACY checks. Also helps readability
since fewer negative checks overall.

Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1470251470-30830-2-git-send-email-daniel.vetter@ffwll.ch
This commit is contained in:
Daniel Vetter
2016-08-03 21:11:10 +02:00
parent 3cbf6a5deb
commit fa5386459f
11 changed files with 47 additions and 51 deletions

View File

@@ -430,9 +430,7 @@ struct drm_agp_head *drm_agp_init(struct drm_device *dev)
* intact so it can still be used. It is safe to call this if AGP is disabled or
* was already removed.
*
* If DRIVER_MODESET is active, nothing is done to protect the modesetting
* resources from getting destroyed. Drivers are responsible of cleaning them up
* during device shutdown.
* Cleanup is only done for drivers who have DRIVER_LEGACY set.
*/
void drm_legacy_agp_clear(struct drm_device *dev)
{
@@ -440,7 +438,7 @@ void drm_legacy_agp_clear(struct drm_device *dev)
if (!dev->agp)
return;
if (drm_core_check_feature(dev, DRIVER_MODESET))
if (!drm_core_check_feature(dev, DRIVER_LEGACY))
return;
list_for_each_entry_safe(entry, tempe, &dev->agp->memory, head) {