Merge tag 'drm-qemu-20161121' of git://git.kraxel.org/linux into drm-next
drm/virtio: fix busid in a different way, allocate more vbufs. drm/qxl: various bugfixes and cleanups, * tag 'drm-qemu-20161121' of git://git.kraxel.org/linux: (224 commits) drm/virtio: allocate some extra bufs qxl: Allow resolution which are not multiple of 8 qxl: Don't notify userspace when monitors config is unchanged qxl: Remove qxl_bo_init() return value qxl: Call qxl_gem_{init, fini} qxl: Add missing '\n' to qxl_io_log() call qxl: Remove unused prototype qxl: Mark some internal functions as static Revert "drm: virtio: reinstate drm_virtio_set_busid()" drm/virtio: fix busid regression drm: re-export drm_dev_set_unique Linux 4.9-rc5 gp8psk: Fix DVB frontend attach gp8psk: fix gp8psk_usb_in_op() logic dvb-usb: move data_mutex to struct dvb_usb_device iio: maxim_thermocouple: detect invalid storage size in read() aoe: fix crash in page count manipulation lightnvm: invalid offset calculation for lba_shift Kbuild: enable -Wmaybe-uninitialized warnings by default pcmcia: fix return value of soc_pcmcia_regulator_set ...
This commit is contained in:
@@ -272,7 +272,7 @@ const struct mdp5_cfg_hw msm8x16_config = {
|
||||
.count = 2,
|
||||
.base = { 0x14000, 0x16000 },
|
||||
.caps = MDP_PIPE_CAP_HFLIP | MDP_PIPE_CAP_VFLIP |
|
||||
MDP_PIPE_CAP_SCALE | MDP_PIPE_CAP_DECIMATION,
|
||||
MDP_PIPE_CAP_DECIMATION,
|
||||
},
|
||||
.pipe_dma = {
|
||||
.count = 1,
|
||||
@@ -282,7 +282,7 @@ const struct mdp5_cfg_hw msm8x16_config = {
|
||||
.lm = {
|
||||
.count = 2, /* LM0 and LM3 */
|
||||
.base = { 0x44000, 0x47000 },
|
||||
.nb_stages = 5,
|
||||
.nb_stages = 8,
|
||||
.max_width = 2048,
|
||||
.max_height = 0xFFFF,
|
||||
},
|
||||
|
@@ -223,12 +223,7 @@ static void blend_setup(struct drm_crtc *crtc)
|
||||
plane_cnt++;
|
||||
}
|
||||
|
||||
/*
|
||||
* If there is no base layer, enable border color.
|
||||
* Although it's not possbile in current blend logic,
|
||||
* put it here as a reminder.
|
||||
*/
|
||||
if (!pstates[STAGE_BASE] && plane_cnt) {
|
||||
if (!pstates[STAGE_BASE]) {
|
||||
ctl_blend_flags |= MDP5_CTL_BLEND_OP_FLAG_BORDER_OUT;
|
||||
DBG("Border Color is enabled");
|
||||
}
|
||||
@@ -365,6 +360,15 @@ static int pstate_cmp(const void *a, const void *b)
|
||||
return pa->state->zpos - pb->state->zpos;
|
||||
}
|
||||
|
||||
/* is there a helper for this? */
|
||||
static bool is_fullscreen(struct drm_crtc_state *cstate,
|
||||
struct drm_plane_state *pstate)
|
||||
{
|
||||
return (pstate->crtc_x <= 0) && (pstate->crtc_y <= 0) &&
|
||||
((pstate->crtc_x + pstate->crtc_w) >= cstate->mode.hdisplay) &&
|
||||
((pstate->crtc_y + pstate->crtc_h) >= cstate->mode.vdisplay);
|
||||
}
|
||||
|
||||
static int mdp5_crtc_atomic_check(struct drm_crtc *crtc,
|
||||
struct drm_crtc_state *state)
|
||||
{
|
||||
@@ -375,21 +379,11 @@ static int mdp5_crtc_atomic_check(struct drm_crtc *crtc,
|
||||
struct plane_state pstates[STAGE_MAX + 1];
|
||||
const struct mdp5_cfg_hw *hw_cfg;
|
||||
const struct drm_plane_state *pstate;
|
||||
int cnt = 0, i;
|
||||
int cnt = 0, base = 0, i;
|
||||
|
||||
DBG("%s: check", mdp5_crtc->name);
|
||||
|
||||
/* verify that there are not too many planes attached to crtc
|
||||
* and that we don't have conflicting mixer stages:
|
||||
*/
|
||||
hw_cfg = mdp5_cfg_get_hw_config(mdp5_kms->cfg);
|
||||
drm_atomic_crtc_state_for_each_plane_state(plane, pstate, state) {
|
||||
if (cnt >= (hw_cfg->lm.nb_stages)) {
|
||||
dev_err(dev->dev, "too many planes!\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
||||
pstates[cnt].plane = plane;
|
||||
pstates[cnt].state = to_mdp5_plane_state(pstate);
|
||||
|
||||
@@ -399,8 +393,24 @@ static int mdp5_crtc_atomic_check(struct drm_crtc *crtc,
|
||||
/* assign a stage based on sorted zpos property */
|
||||
sort(pstates, cnt, sizeof(pstates[0]), pstate_cmp, NULL);
|
||||
|
||||
/* if the bottom-most layer is not fullscreen, we need to use
|
||||
* it for solid-color:
|
||||
*/
|
||||
if ((cnt > 0) && !is_fullscreen(state, &pstates[0].state->base))
|
||||
base++;
|
||||
|
||||
/* verify that there are not too many planes attached to crtc
|
||||
* and that we don't have conflicting mixer stages:
|
||||
*/
|
||||
hw_cfg = mdp5_cfg_get_hw_config(mdp5_kms->cfg);
|
||||
|
||||
if ((cnt + base) >= hw_cfg->lm.nb_stages) {
|
||||
dev_err(dev->dev, "too many planes!\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
for (i = 0; i < cnt; i++) {
|
||||
pstates[i].state->stage = STAGE_BASE + i;
|
||||
pstates[i].state->stage = STAGE_BASE + i + base;
|
||||
DBG("%s: assign pipe %s on stage=%d", mdp5_crtc->name,
|
||||
pipe2name(mdp5_plane_pipe(pstates[i].plane)),
|
||||
pstates[i].state->stage);
|
||||
|
@@ -307,8 +307,7 @@ static int mdp5_plane_atomic_check(struct drm_plane *plane,
|
||||
format = to_mdp_format(msm_framebuffer_format(state->fb));
|
||||
if (MDP_FORMAT_IS_YUV(format) &&
|
||||
!pipe_supports_yuv(mdp5_plane->caps)) {
|
||||
dev_err(plane->dev->dev,
|
||||
"Pipe doesn't support YUV\n");
|
||||
DBG("Pipe doesn't support YUV\n");
|
||||
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -316,8 +315,7 @@ static int mdp5_plane_atomic_check(struct drm_plane *plane,
|
||||
if (!(mdp5_plane->caps & MDP_PIPE_CAP_SCALE) &&
|
||||
(((state->src_w >> 16) != state->crtc_w) ||
|
||||
((state->src_h >> 16) != state->crtc_h))) {
|
||||
dev_err(plane->dev->dev,
|
||||
"Pipe doesn't support scaling (%dx%d -> %dx%d)\n",
|
||||
DBG("Pipe doesn't support scaling (%dx%d -> %dx%d)\n",
|
||||
state->src_w >> 16, state->src_h >> 16,
|
||||
state->crtc_w, state->crtc_h);
|
||||
|
||||
@@ -333,8 +331,7 @@ static int mdp5_plane_atomic_check(struct drm_plane *plane,
|
||||
|
||||
if ((vflip && !(mdp5_plane->caps & MDP_PIPE_CAP_VFLIP)) ||
|
||||
(hflip && !(mdp5_plane->caps & MDP_PIPE_CAP_HFLIP))) {
|
||||
dev_err(plane->dev->dev,
|
||||
"Pipe doesn't support flip\n");
|
||||
DBG("Pipe doesn't support flip\n");
|
||||
|
||||
return -EINVAL;
|
||||
}
|
||||
|
مرجع در شماره جدید
Block a user