|
@@ -60,11 +60,12 @@ static int hdlcd_set_pxl_fmt(struct drm_crtc *crtc)
|
|
|
{
|
|
|
unsigned int btpp;
|
|
|
struct hdlcd_drm_private *hdlcd = crtc_to_hdlcd_priv(crtc);
|
|
|
+ const struct drm_framebuffer *fb = crtc->primary->state->fb;
|
|
|
uint32_t pixel_format;
|
|
|
struct simplefb_format *format = NULL;
|
|
|
int i;
|
|
|
|
|
|
- pixel_format = crtc->primary->state->fb->pixel_format;
|
|
|
+ pixel_format = fb->pixel_format;
|
|
|
|
|
|
for (i = 0; i < ARRAY_SIZE(supported_formats); i++) {
|
|
|
if (supported_formats[i].fourcc == pixel_format)
|
|
@@ -220,27 +221,28 @@ static int hdlcd_plane_atomic_check(struct drm_plane *plane,
|
|
|
static void hdlcd_plane_atomic_update(struct drm_plane *plane,
|
|
|
struct drm_plane_state *state)
|
|
|
{
|
|
|
+ struct drm_framebuffer *fb = plane->state->fb;
|
|
|
struct hdlcd_drm_private *hdlcd;
|
|
|
struct drm_gem_cma_object *gem;
|
|
|
u32 src_w, src_h, dest_w, dest_h;
|
|
|
dma_addr_t scanout_start;
|
|
|
|
|
|
- if (!plane->state->fb)
|
|
|
+ if (!fb)
|
|
|
return;
|
|
|
|
|
|
src_w = plane->state->src_w >> 16;
|
|
|
src_h = plane->state->src_h >> 16;
|
|
|
dest_w = plane->state->crtc_w;
|
|
|
dest_h = plane->state->crtc_h;
|
|
|
- gem = drm_fb_cma_get_gem_obj(plane->state->fb, 0);
|
|
|
- scanout_start = gem->paddr + plane->state->fb->offsets[0] +
|
|
|
- plane->state->crtc_y * plane->state->fb->pitches[0] +
|
|
|
+ gem = drm_fb_cma_get_gem_obj(fb, 0);
|
|
|
+ scanout_start = gem->paddr + fb->offsets[0] +
|
|
|
+ plane->state->crtc_y * fb->pitches[0] +
|
|
|
plane->state->crtc_x *
|
|
|
- drm_format_plane_cpp(plane->state->fb->pixel_format, 0);
|
|
|
+ drm_format_plane_cpp(fb->pixel_format, 0);
|
|
|
|
|
|
hdlcd = plane->dev->dev_private;
|
|
|
- hdlcd_write(hdlcd, HDLCD_REG_FB_LINE_LENGTH, plane->state->fb->pitches[0]);
|
|
|
- hdlcd_write(hdlcd, HDLCD_REG_FB_LINE_PITCH, plane->state->fb->pitches[0]);
|
|
|
+ hdlcd_write(hdlcd, HDLCD_REG_FB_LINE_LENGTH, fb->pitches[0]);
|
|
|
+ hdlcd_write(hdlcd, HDLCD_REG_FB_LINE_PITCH, fb->pitches[0]);
|
|
|
hdlcd_write(hdlcd, HDLCD_REG_FB_LINE_COUNT, dest_h - 1);
|
|
|
hdlcd_write(hdlcd, HDLCD_REG_FB_BASE, scanout_start);
|
|
|
}
|