#include "i915_vgpu.h"
#include "intel_drv.h"
-static struct drm_driver driver;
+static drm_driver_no_const driver;
static unsigned int i915_load_fail_count;
* locking inversion with the driver load path. And the access here is
* completely racy anyway. So don't bother with locking for now.
*/
- return dev->open_count == 0;
+ return local_read(&dev->open_count) == 0;
}
static const struct vga_switcheroo_client_ops i915_switcheroo_ops = {
struct drm_i915_private *dev_priv;
int ret;
- if (i915.nuclear_pageflip)
+ if (i915.nuclear_pageflip) {
+ pax_open_kernel();
driver.driver_features |= DRIVER_ATOMIC;
+ pax_close_kernel();
+ }
ret = -ENOMEM;
dev_priv = kzalloc(sizeof(*dev_priv), GFP_KERNEL);
DRM_IOCTL_DEF_DRV(I915_GEM_CONTEXT_SETPARAM, i915_gem_context_setparam_ioctl, DRM_RENDER_ALLOW),
};
-static struct drm_driver driver = {
+static drm_driver_no_const driver __read_only = {
/* Don't use MTRRs here; the Xserver or userspace app should
* deal with them for Intel hardware.
*/