mode_cmd->width = sizes->surface_width;
mode_cmd->height = sizes->surface_height;
- mode_cmd->pitches[0] = ALIGN(mode_cmd->width * DIV_ROUND_UP(sizes->surface_bpp, 8), 64);
+ mode_cmd->pitches[0] = intel_fbdev_fb_pitch_align(mode_cmd->width * DIV_ROUND_UP(sizes->surface_bpp, 8));
mode_cmd->pixel_format = drm_mode_legacy_fb_format(sizes->surface_bpp,
sizes->surface_depth);
mode_cmd->modifier[0] = DRM_FORMAT_MOD_LINEAR;
#include "i915_drv.h"
#include "intel_fbdev_fb.h"
+u32 intel_fbdev_fb_pitch_align(u32 stride)
+{
+ return ALIGN(stride, 64);
+}
+
struct drm_gem_object *intel_fbdev_fb_bo_create(struct drm_device *drm, int size)
{
struct drm_i915_private *dev_priv = to_i915(drm);
#ifndef __INTEL_FBDEV_FB_H__
#define __INTEL_FBDEV_FB_H__
+#include <linux/types.h>
+
struct drm_device;
struct drm_gem_object;
struct drm_mode_fb_cmd2;
struct fb_info;
struct i915_vma;
+u32 intel_fbdev_fb_pitch_align(u32 stride);
struct drm_gem_object *intel_fbdev_fb_bo_create(struct drm_device *drm, int size);
void intel_fbdev_fb_bo_destroy(struct drm_gem_object *obj);
int intel_fbdev_fb_fill_info(struct drm_device *drm, struct fb_info *info,
#include <generated/xe_wa_oob.h>
+/*
+ * FIXME: There shouldn't be any reason to have XE_PAGE_SIZE stride
+ * alignment. The same 64 as i915 uses should be fine, and we shouldn't need to
+ * have driver specific values. However, dropping the stride alignment to 64
+ * leads to underflowing the bo pin count in the atomic cleanup work.
+ */
+u32 intel_fbdev_fb_pitch_align(u32 stride)
+{
+ return ALIGN(stride, XE_PAGE_SIZE);
+}
+
struct drm_gem_object *intel_fbdev_fb_bo_create(struct drm_device *drm, int size)
{
struct xe_device *xe = to_xe_device(drm);