Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f9644839 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "drm: drm bootsplash enable for display port"

parents a591cf60 69b6da1d
Loading
Loading
Loading
Loading
+36 −55
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@ struct drm_bootsplash {
	struct drm_client_dev client;
	struct mutex lock;
	struct drm_client_display *display;
	struct drm_client_buffer *buffer[2];
	struct drm_client_buffer *buffer;
	struct work_struct worker;
	struct completion xref;
	bool started;
@@ -37,36 +37,27 @@ struct drm_bootsplash {

static void drm_bootsplash_buffer_delete(struct drm_bootsplash *splash)
{
	unsigned int i;

	for (i = 0; i < 2; i++) {
		if (!IS_ERR_OR_NULL(splash->buffer[i]))
			drm_client_framebuffer_delete(splash->buffer[i]);
		splash->buffer[i] = NULL;
	}
	if (!IS_ERR_OR_NULL(splash->buffer))
		drm_client_framebuffer_delete(splash->buffer);
	splash->buffer = NULL;
}

static int drm_bootsplash_buffer_create(
			struct drm_bootsplash *splash, u32 width, u32 height)
{
	unsigned int i;

	for (i = 0; i < 2; i++) {
		splash->buffer[i] =
	splash->buffer =
		drm_client_framebuffer_create(&splash->client,
				width, height, SPLASH_IMAGE_FORMAT);
		if (IS_ERR(splash->buffer[i])) {
	if (IS_ERR(splash->buffer)) {
		drm_bootsplash_buffer_delete(splash);
			return PTR_ERR(splash->buffer[i]);
		return PTR_ERR(splash->buffer);
	}

		splash->buffer[i]->vaddr =
			drm_client_buffer_vmap(splash->buffer[i]);
		if (!(splash->buffer[i]->vaddr))
	splash->buffer->vaddr =
		drm_client_buffer_vmap(splash->buffer);
	if (!(splash->buffer->vaddr))
		DRM_ERROR("drm_client_buffer_vmap fail\n");

	}

	return 0;
}

@@ -80,7 +71,7 @@ static int drm_bootsplash_display_probe(struct drm_bootsplash *splash)
	bool tiled = false;
	int ret;

	ret = drm_client_modeset_probe(client, 0, 0);
	ret = drm_client_modeset_probe(client, 1920, 1080);
	if (ret)
		return ret;

@@ -157,9 +148,9 @@ static int drm_bootsplash_display_probe(struct drm_bootsplash *splash)
		modeset->num_connectors = 0;
	}

	if (!splash->buffer[0] ||
	    splash->buffer[0]->fb->width != width ||
	    splash->buffer[0]->fb->height != height) {
	if (!splash->buffer ||
	    splash->buffer->fb->width != width ||
	    splash->buffer->fb->height != height) {
		drm_bootsplash_buffer_delete(splash);
		ret = drm_bootsplash_buffer_create(splash, width, height);
	}
@@ -171,7 +162,7 @@ static int drm_bootsplash_display_probe(struct drm_bootsplash *splash)
}

static int drm_bootsplash_display_commit_buffer(
			struct drm_bootsplash *splash, unsigned int num)
			struct drm_bootsplash *splash)
{
	struct drm_client_dev *client = &splash->client;
	struct drm_mode_set *modeset;
@@ -179,7 +170,7 @@ static int drm_bootsplash_display_commit_buffer(
	mutex_lock(&client->modeset_mutex);
	drm_client_for_each_modeset(modeset, client) {
		if (modeset->mode)
			modeset->fb = splash->buffer[num]->fb;
			modeset->fb = splash->buffer->fb;
	}
	mutex_unlock(&client->modeset_mutex);

@@ -206,15 +197,14 @@ static void drm_bootsplash_draw_box(struct drm_client_buffer *buffer)
	}
}

static int drm_bootsplash_draw(struct drm_bootsplash *splash,
							unsigned int buffer_num)
static int drm_bootsplash_draw(struct drm_bootsplash *splash)
{
	if (!splash->buffer[buffer_num])
	if (!splash->buffer)
		return -ENOENT;

	drm_bootsplash_draw_box(splash->buffer[buffer_num]);
	drm_bootsplash_draw_box(splash->buffer);

	return drm_bootsplash_display_commit_buffer(splash, buffer_num);
	return drm_bootsplash_display_commit_buffer(splash);
}

static void drm_bootsplash_worker(struct work_struct *work)
@@ -223,35 +213,26 @@ static void drm_bootsplash_worker(struct work_struct *work)
		container_of(work, struct drm_bootsplash, worker);
	struct drm_client_dev *client = &splash->client;
	struct drm_device *dev = client->dev;
	unsigned int buffer_num = 0;
	bool stop = false;
	int ret = 0, times = 0;
	int ret = 0;

	while (!splash->stop) {
	mutex_lock(&splash->lock);

	stop = splash->stop;

		buffer_num = !buffer_num;

		ret = drm_bootsplash_draw(splash, buffer_num);
	ret = drm_bootsplash_draw(splash);

	mutex_unlock(&splash->lock);

	if (stop || ret == -ENOENT || ret == -EBUSY)
			break;
		goto skip;

		if (times == 10)
			splash->stop = true;
		else
			times++;

		msleep(500);
	}
	msleep(5000);
	splash->stop = true;

	if ((times == 10) && splash->stop)
skip:
	drm_lastclose(dev);

	drm_bootsplash_buffer_delete(splash);

	DRM_DEBUG("Bootsplash has stopped (start=%u, stop=%u, ret=%d).\n",
+15 −5
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@
#include <linux/of_irq.h>
#include <linux/hdcp_qseecom.h>

#include <drm/drm_client.h>
#include "sde_connector.h"

#include "msm_drv.h"
@@ -98,6 +99,8 @@ static const struct of_device_id dp_dt_match[] = {
	{}
};

static void dp_display_update_hdcp_info(struct dp_display_private *dp);

static bool dp_display_framework_ready(struct dp_display_private *dp)
{
	return dp->dp_display.post_open ? false : true;
@@ -143,6 +146,13 @@ static void dp_display_hdcp_cb_work(struct work_struct *work)

	dp = container_of(dw, struct dp_display_private, hdcp_cb_work);

	dp_display_update_hdcp_info(dp);

	if (!dp_display_is_hdcp_enabled(dp))
		return;

	dp->link->hdcp_status.hdcp_state = HDCP_STATE_AUTHENTICATING;

	rc = dp->catalog->ctrl.read_hdcp_status(&dp->catalog->ctrl);
	if (rc >= 0) {
		hdcp_auth_state = (rc >> 20) & 0x3;
@@ -467,8 +477,11 @@ static int dp_display_send_hpd_notification(struct dp_display_private *dp,

	dp->dp_display.is_connected = hpd;

	if (!dp_display_framework_ready(dp))
	if (!dp_display_framework_ready(dp)) {
		pr_err("%s: dp display framework not ready\n", __func__);
		drm_client_dev_register(dp->dp_display.drm_dev);
		return ret;
	}

	dp->aux->state |= DP_STATE_NOTIFICATION_SENT;

@@ -1142,12 +1155,9 @@ static int dp_display_post_enable(struct dp_display *dp_display)
		dp->audio_status = dp->audio->on(dp->audio);
	}

	dp_display_update_hdcp_info(dp);

	if (dp_display_is_hdcp_enabled(dp)) {
	if (dp->hdcp.feature_enabled && 0) { /* bootsplash check */
		cancel_delayed_work_sync(&dp->hdcp_cb_work);

		dp->link->hdcp_status.hdcp_state = HDCP_STATE_AUTHENTICATING;
		queue_delayed_work(dp->wq, &dp->hdcp_cb_work, HZ / 2);
	}

+1 −0
Original line number Diff line number Diff line
@@ -279,6 +279,7 @@ static int msm_drm_uninit(struct device *dev)
	drm_vblank_cleanup(ddev);

	if (priv->registered) {
		drm_client_dev_unregister(ddev);
		drm_dev_unregister(ddev);
		priv->registered = false;
	}
+2 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2016-2019, The Linux Foundation. All rights reserved.
 * Copyright (c) 2016-2019, 2021, The Linux Foundation. All rights reserved.
 * Copyright (C) 2013 Red Hat
 * Author: Rob Clark <robdclark@gmail.com>
 *
@@ -45,6 +45,7 @@
#include <drm/drm_fb_helper.h>
#include <drm/msm_drm.h>
#include <drm/drm_gem.h>
#include <drm/drm_client.h>

#include "sde_power_handle.h"

+3 −2
Original line number Diff line number Diff line
/*
 * Copyright (c) 2014-2019 The Linux Foundation. All rights reserved.
 * Copyright (c) 2014-2019,2021 The Linux Foundation. All rights reserved.
 * Copyright (C) 2013 Red Hat
 * Author: Rob Clark <robdclark@gmail.com>
 *
@@ -2376,6 +2376,7 @@ static void sde_crtc_vblank_cb(void *data)
		sde_crtc->vblank_cb_count++;

	sde_crtc->vblank_last_cb_time = ktime_get();
	if (sde_crtc->vsync_event_sf)
		sysfs_notify_dirent(sde_crtc->vsync_event_sf);

	drm_crtc_handle_vblank(crtc);