mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 03:04:51 +01:00
drm/{i915, xe}/display: make pxp key check part of bo interface
Add intel_bo_key_check() next to intel_bo_is_protected() where it feels like it belongs, and drop the extra pxp compat header. Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Link: https://patch.msgid.link/20251201172730.2154668-1-jani.nikula@intel.com Signed-off-by: Jani Nikula <jani.nikula@intel.com>
This commit is contained in:
parent
156fd724e1
commit
ee30fde96b
5 changed files with 15 additions and 32 deletions
|
|
@ -6,6 +6,7 @@
|
|||
#include "gem/i915_gem_mman.h"
|
||||
#include "gem/i915_gem_object.h"
|
||||
#include "gem/i915_gem_object_frontbuffer.h"
|
||||
#include "pxp/intel_pxp.h"
|
||||
#include "i915_debugfs.h"
|
||||
#include "intel_bo.h"
|
||||
|
||||
|
|
@ -29,6 +30,11 @@ bool intel_bo_is_protected(struct drm_gem_object *obj)
|
|||
return i915_gem_object_is_protected(to_intel_bo(obj));
|
||||
}
|
||||
|
||||
int intel_bo_key_check(struct drm_gem_object *obj)
|
||||
{
|
||||
return intel_pxp_key_check(obj, false);
|
||||
}
|
||||
|
||||
int intel_bo_fb_mmap(struct drm_gem_object *obj, struct vm_area_struct *vma)
|
||||
{
|
||||
return i915_gem_fb_mmap(to_intel_bo(obj), vma);
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ bool intel_bo_is_tiled(struct drm_gem_object *obj);
|
|||
bool intel_bo_is_userptr(struct drm_gem_object *obj);
|
||||
bool intel_bo_is_shmem(struct drm_gem_object *obj);
|
||||
bool intel_bo_is_protected(struct drm_gem_object *obj);
|
||||
int intel_bo_key_check(struct drm_gem_object *obj);
|
||||
int intel_bo_fb_mmap(struct drm_gem_object *obj, struct vm_area_struct *vma);
|
||||
int intel_bo_read_from_page(struct drm_gem_object *obj, u64 offset, void *dst, int size);
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@
|
|||
#include <drm/drm_fourcc.h>
|
||||
#include <drm/drm_print.h>
|
||||
|
||||
#include "pxp/intel_pxp.h"
|
||||
#include "intel_bo.h"
|
||||
#include "intel_de.h"
|
||||
#include "intel_display_irq.h"
|
||||
|
|
@ -2290,7 +2289,7 @@ static void check_protection(struct intel_plane_state *plane_state)
|
|||
if (DISPLAY_VER(display) < 11)
|
||||
return;
|
||||
|
||||
plane_state->decrypt = intel_pxp_key_check(obj, false) == 0;
|
||||
plane_state->decrypt = intel_bo_key_check(obj) == 0;
|
||||
plane_state->force_black = intel_bo_is_protected(obj) &&
|
||||
!plane_state->decrypt;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,29 +0,0 @@
|
|||
/* SPDX-License-Identifier: MIT */
|
||||
/*
|
||||
* Copyright © 2023 Intel Corporation
|
||||
*/
|
||||
|
||||
#ifndef __INTEL_PXP_H__
|
||||
#define __INTEL_PXP_H__
|
||||
|
||||
#include <linux/errno.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
#include "xe_pxp.h"
|
||||
|
||||
struct drm_gem_object;
|
||||
|
||||
static inline int intel_pxp_key_check(struct drm_gem_object *obj, bool assign)
|
||||
{
|
||||
/*
|
||||
* The assign variable is used in i915 to assign the key to the BO at
|
||||
* first submission time. In Xe the key is instead assigned at BO
|
||||
* creation time, so the assign variable must always be false.
|
||||
*/
|
||||
if (assign)
|
||||
return -EINVAL;
|
||||
|
||||
return xe_pxp_obj_key_check(obj);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
@ -3,9 +3,10 @@
|
|||
|
||||
#include <drm/drm_gem.h>
|
||||
|
||||
#include "xe_bo.h"
|
||||
#include "intel_bo.h"
|
||||
#include "intel_frontbuffer.h"
|
||||
#include "xe_bo.h"
|
||||
#include "xe_pxp.h"
|
||||
|
||||
bool intel_bo_is_tiled(struct drm_gem_object *obj)
|
||||
{
|
||||
|
|
@ -29,6 +30,11 @@ bool intel_bo_is_protected(struct drm_gem_object *obj)
|
|||
return xe_bo_is_protected(gem_to_xe_bo(obj));
|
||||
}
|
||||
|
||||
int intel_bo_key_check(struct drm_gem_object *obj)
|
||||
{
|
||||
return xe_pxp_obj_key_check(obj);
|
||||
}
|
||||
|
||||
int intel_bo_fb_mmap(struct drm_gem_object *obj, struct vm_area_struct *vma)
|
||||
{
|
||||
return drm_gem_prime_mmap(obj, vma);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue