Skip to content

Commit

Permalink
use RGB plane 0 for hardware cursor
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaello7 committed Aug 21, 2017
1 parent ded6119 commit 80c149f
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 12 deletions.
20 changes: 18 additions & 2 deletions arch/arm64/boot/dts/nexell/s5p6818-nanopi-m3.dts
Original file line number Diff line number Diff line change
Expand Up @@ -418,13 +418,29 @@
reg = <0>;
back_color = < 0x0 >;
color_key = < 0x0 >;
plane-names = "video", "primary", "rgb";
/* Port 0 has two RGB planes and one video plane. These planes
* are arranged in z-order: RGB plane 0 is below plane 1,
* video plane may be set at any position in z-order.
*
* Possible names for RGB planes: "primary", "rgb", "cursor"
* Possible name for video plane: "video"
* Two RGB plane names and one video plane name may be specified in
* "plane-names" property.
* RGB plane "primary" will be used as root window.
* RGB plane "cursor" will be used for cursor.
* RGB plane "rgb" and video plane are overlay planes, normally
* not used by X-windows.
*
* Order of plane names specifies z-order of planes, top to bottom.
*/
plane-names = "cursor", "video", "primary";
};
port@1 {
reg = <1>;
back_color = < 0x0 >;
color_key = < 0x0 >;
plane-names = "video", "primary", "rgb";
/* Port 1 has one RGB plane and one video plane only. */
plane-names = "video", "primary";
};
};
};
Expand Down
27 changes: 17 additions & 10 deletions drivers/gpu/drm/nexell/nx_drm_crtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -534,10 +534,10 @@ static int nx_drm_crtc_parse_dt_setup(struct drm_device *drm,
}

static int nx_drm_crtc_create_planes(struct drm_device *drm,
struct drm_crtc *crtc, int pipe)
struct drm_crtc *crtc)
{
struct drm_plane **planes;
struct drm_plane *plane;
struct drm_plane *plane, *plane_primary = NULL, *plane_cursor = NULL;
struct nx_drm_crtc *nx_crtc = to_nx_crtc(crtc);
struct dp_plane_top *top = &nx_crtc->top;
int i = 0, ret = 0;
Expand All @@ -560,22 +560,29 @@ static int nx_drm_crtc_create_planes(struct drm_device *drm,
plane_num = video ? PLANE_VIDEO_NUM : num++;

plane = nx_drm_plane_init(
drm, crtc, (1 << pipe), drm_type, plane_num);
drm, crtc, drm_crtc_mask(crtc), drm_type, plane_num);
if (IS_ERR(plane)) {
ret = PTR_ERR(plane);
goto err_plane;
}

if (DRM_PLANE_TYPE_PRIMARY == drm_type) {
switch( drm_type ) {
case DRM_PLANE_TYPE_PRIMARY:
top->primary_plane = num - 1;
ret = drm_crtc_init_with_planes(drm,
crtc, plane, NULL, &nx_crtc_funcs, NULL);
if (0 > ret)
goto err_plane;
plane_primary = plane;
break;
case DRM_PLANE_TYPE_CURSOR:
plane_cursor = plane;
break;
default:
break;
}
planes[i] = plane;
}

ret = drm_crtc_init_with_planes(drm,
crtc, plane_primary, plane_cursor, &nx_crtc_funcs, NULL);
if (0 > ret)
goto err_plane;
drm_crtc_helper_add(crtc, &nx_crtc_helper_funcs);
kfree(planes);

Expand Down Expand Up @@ -641,7 +648,7 @@ int nx_drm_crtc_init(struct drm_device *drm)
return ret;

nx_drm_dp_crtc_init(drm, &nx_crtc->crtc, pipe);
ret = nx_drm_crtc_create_planes(drm, &nx_crtc->crtc, pipe);
ret = nx_drm_crtc_create_planes(drm, &nx_crtc->crtc);
if (0 > ret)
goto err_crtc;

Expand Down

0 comments on commit 80c149f

Please sign in to comment.