@@ -24,6 +24,9 @@ use gem::BaseObject;
pub trait DriverObject: gem::BaseDriverObject<Object<Self>> {
/// Parent `Driver` for this object.
type Driver: drv::Driver;
+
+ /// Define the map object write-combined
+ const MAP_WC: bool = false;
}
// FIXME: This is terrible and I don't know how to avoid it
@@ -110,6 +113,8 @@ unsafe extern "C" fn gem_create_object<T: DriverObject>(
let new: &mut Object<T> = unsafe { &mut *(p as *mut _) };
new.obj.base.funcs = &Object::<T>::VTABLE;
+ new.obj.map_wc = <T>::MAP_WC;
+
&mut new.obj.base
}
Some drivers use the gem_create_object callback to define the mapping of the object write-combined (map_wc). Currently, the DRM Rust abstractions doesn't allow such operation. So, add a constant to the DriverObject trait to allow drivers to set map_wc on the gem_create_object callback. By default, the constant returns false, which is the shmem default value. Signed-off-by: Maíra Canal <mcanal@igalia.com> --- rust/kernel/drm/gem/shmem.rs | 5 +++++ 1 file changed, 5 insertions(+)