There's no need to use the intel specific struct intel_framebuffer*
type in the initial plane_config structure. Just make it a
struct drm_framebuffer*.
I think the fewer special types we expose in the interface (even
if just pointers) the better. At least then there is no need to
change the interface definition if we ever change the internal
types. And I hope that the existing examples will generally
encourage people to not expose more special types unless
absolutely necessary.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/20260410150449.9699-5-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
fb->width, fb->height, fb->format->cpp[0] * 8,
base, fb->pitches[0], plane_config->size);
- plane_config->fb = intel_fb;
+ plane_config->fb = &intel_fb->base;
}
bool i9xx_fixup_initial_plane_config(struct intel_crtc *crtc,
};
struct intel_initial_plane_config {
- struct intel_framebuffer *fb;
+ struct drm_framebuffer *fb;
struct i915_vma *vma;
int size;
u32 base;
intel_alloc_initial_plane_obj(struct intel_display *display,
struct intel_initial_plane_config *plane_config)
{
- struct intel_framebuffer *fb = plane_config->fb;
+ struct drm_framebuffer *fb = plane_config->fb;
- switch (fb->base.modifier) {
+ switch (fb->modifier) {
case DRM_FORMAT_MOD_LINEAR:
case I915_FORMAT_MOD_X_TILED:
case I915_FORMAT_MOD_Y_TILED:
break;
default:
drm_dbg_kms(display->drm, "Unsupported modifier for initial FB: 0x%llx\n",
- fb->base.modifier);
+ fb->modifier);
return NULL;
}
return;
if (intel_alloc_initial_plane_obj(display, plane_config)) {
- fb = &plane_config->fb->base;
+ fb = plane_config->fb;
vma = plane_config->vma;
} else {
const struct intel_plane_state *other_plane_state;
struct intel_initial_plane_config *plane_config)
{
if (plane_config->fb) {
- struct drm_framebuffer *fb = &plane_config->fb->base;
+ struct drm_framebuffer *fb = plane_config->fb;
/* We may only have the stub and not a full framebuffer */
if (drm_framebuffer_read_refcount(fb))
fb->width, fb->height, fb->format->cpp[0] * 8,
base, fb->pitches[0], plane_config->size);
- plane_config->fb = intel_fb;
+ plane_config->fb = &intel_fb->base;
return;
error:
i915_gem_object_set_cache_coherency(obj, HAS_WT(i915) ?
I915_CACHE_WT : I915_CACHE_NONE);
- tiling = intel_fb_modifier_to_tiling(plane_config->fb->base.modifier);
+ tiling = intel_fb_modifier_to_tiling(plane_config->fb->modifier);
switch (tiling) {
case I915_TILING_NONE:
case I915_TILING_X:
case I915_TILING_Y:
obj->tiling_and_stride =
- plane_config->fb->base.pitches[0] |
+ plane_config->fb->pitches[0] |
tiling;
break;
default:
{
struct drm_i915_private *i915 = to_i915(drm);
struct drm_mode_fb_cmd2 mode_cmd = {};
- struct drm_framebuffer *fb = &plane_config->fb->base;
+ struct drm_framebuffer *fb = plane_config->fb;
struct i915_vma *vma;
vma = initial_plane_vma(i915, plane_config);
{
struct xe_device *xe = to_xe_device(drm);
struct drm_mode_fb_cmd2 mode_cmd = { 0 };
- struct drm_framebuffer *fb = &plane_config->fb->base;
+ struct drm_framebuffer *fb = plane_config->fb;
struct xe_bo *bo;
mode_cmd.pixel_format = fb->format->format;