Message ID | 1423505008-15515-4-git-send-email-daniel.vetter@ffwll.ch (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Mon, Feb 09, 2015 at 07:03:26PM +0100, Daniel Vetter wrote: > Just a little demo really. We probably need to introduce skl specific > functions for a lot of the format validation stuff, or at least > helpers. Specifically I think intel_framebuffer_init and > intel_fb_align_height must be adjusted to have an i915_ and a skl_ > variant. And only shared code should be converted to fb modifiers, > platform code (like the plane config readout can keep on using old > tiling_mode defines to avoid some churn). > > Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com> > Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> > --- > drivers/gpu/drm/i915/intel_display.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c > index 2d69cce03ab5..41b3ddc4068d 100644 > --- a/drivers/gpu/drm/i915/intel_display.c > +++ b/drivers/gpu/drm/i915/intel_display.c > @@ -2773,11 +2773,11 @@ static void skylake_update_primary_plane(struct drm_crtc *crtc, > * The stride is either expressed as a multiple of 64 bytes chunks for > * linear buffers or in number of tiles for tiled buffers. > */ > - switch (obj->tiling_mode) { > - case I915_TILING_NONE: > + switch (fb->modifier[0]) { > + case DRM_FORMAT_MOD_NONE: > stride = fb->pitches[0] >> 6; > break; > - case I915_TILING_X: > + case I915_FORMAT_MOD_X_TILED: > plane_ctl |= PLANE_CTL_TILED_X; > stride = fb->pitches[0] >> 9; > break; Just a remark across the board is that this code won't work as we add new types of modifiers besides tiling. Might as wels reserve tiling bits today and select on them.
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 2d69cce03ab5..41b3ddc4068d 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -2773,11 +2773,11 @@ static void skylake_update_primary_plane(struct drm_crtc *crtc, * The stride is either expressed as a multiple of 64 bytes chunks for * linear buffers or in number of tiles for tiled buffers. */ - switch (obj->tiling_mode) { - case I915_TILING_NONE: + switch (fb->modifier[0]) { + case DRM_FORMAT_MOD_NONE: stride = fb->pitches[0] >> 6; break; - case I915_TILING_X: + case I915_FORMAT_MOD_X_TILED: plane_ctl |= PLANE_CTL_TILED_X; stride = fb->pitches[0] >> 9; break;
Just a little demo really. We probably need to introduce skl specific functions for a lot of the format validation stuff, or at least helpers. Specifically I think intel_framebuffer_init and intel_fb_align_height must be adjusted to have an i915_ and a skl_ variant. And only shared code should be converted to fb modifiers, platform code (like the plane config readout can keep on using old tiling_mode defines to avoid some churn). Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> --- drivers/gpu/drm/i915/intel_display.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)