public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Corentin Labbe <clabbe@baylibre.com>
To: gregkh@linuxfoundation.org, mchehab@kernel.org,
	hverkuil@xs4all.nl, laurent.pinchart@ideasonboard.com
Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
	linux-media@vger.kernel.org, Corentin Labbe <clabbe@baylibre.com>
Subject: [PATCH RFT/RFC v2 40/47] staging: media: zoran: remove framebuffer support
Date: Fri, 25 Sep 2020 18:30:50 +0000	[thread overview]
Message-ID: <1601058657-14042-41-git-send-email-clabbe@baylibre.com> (raw)
In-Reply-To: <1601058657-14042-1-git-send-email-clabbe@baylibre.com>

The framebuffer support is obsolete, so let's reduce code size.

Signed-off-by: Corentin Labbe <clabbe@baylibre.com>
---
 drivers/staging/media/zoran/zoran.h        |  4 -
 drivers/staging/media/zoran/zoran_card.c   |  6 --
 drivers/staging/media/zoran/zoran_driver.c | 85 ----------------------
 3 files changed, 95 deletions(-)

diff --git a/drivers/staging/media/zoran/zoran.h b/drivers/staging/media/zoran/zoran.h
index 294e52d78e1b..0246635e0eac 100644
--- a/drivers/staging/media/zoran/zoran.h
+++ b/drivers/staging/media/zoran/zoran.h
@@ -299,10 +299,6 @@ struct zoran {
 
 	/* Current buffer params */
 	unsigned int buffer_size;
-	void *vbuf_base;
-	int vbuf_height, vbuf_width;
-	int vbuf_depth;
-	int vbuf_bytesperline;
 
 	wait_queue_head_t v4l_capq;
 
diff --git a/drivers/staging/media/zoran/zoran_card.c b/drivers/staging/media/zoran/zoran_card.c
index 0a193283eefc..28a403257bb9 100644
--- a/drivers/staging/media/zoran/zoran_card.c
+++ b/drivers/staging/media/zoran/zoran_card.c
@@ -900,12 +900,6 @@ static int zr36057_init(struct zoran *zr)
 	zr->jpg_buffers.allocated = 0;
 	zr->v4l_buffers.allocated = 0;
 
-	zr->vbuf_base = (void *)vidmem;
-	zr->vbuf_width = 0;
-	zr->vbuf_height = 0;
-	zr->vbuf_depth = 0;
-	zr->vbuf_bytesperline = 0;
-
 	/* Avoid nonsense settings from user for default input/norm */
 	if (default_norm < 0 || default_norm > 2)
 		default_norm = 0;
diff --git a/drivers/staging/media/zoran/zoran_driver.c b/drivers/staging/media/zoran/zoran_driver.c
index 43f7c0c02876..bcbe2c78ea16 100644
--- a/drivers/staging/media/zoran/zoran_driver.c
+++ b/drivers/staging/media/zoran/zoran_driver.c
@@ -881,48 +881,6 @@ static int zoran_close(struct file *file)
 	return 0;
 }
 
-static int setup_fbuffer(struct zoran_fh *fh, void *base, const struct zoran_format *fmt,
-			 int width, int height, int bytesperline)
-{
-	struct zoran *zr = fh->zr;
-
-	/* (Ronald) v4l/v4l2 guidelines */
-	if (!capable(CAP_SYS_ADMIN) && !capable(CAP_SYS_RAWIO))
-		return -EPERM;
-
-	/*
-	 * Don't allow frame buffer overlay if PCI or AGP is buggy, or on
-	   ALi Magik (that needs very low latency while the card needs a
-	   higher value always)
-	 */
-
-	if (pci_pci_problems & (PCIPCI_FAIL | PCIAGP_FAIL | PCIPCI_ALIMAGIK))
-		return -ENXIO;
-
-	/* we need a bytesperline value, even if not given */
-	if (!bytesperline)
-		bytesperline = width * ((fmt->depth + 7) & ~7) / 8;
-
-	if (height <= 0 || width <= 0 || bytesperline <= 0) {
-		pci_err(zr->pci_dev, "%s - invalid height/width/bpl value (%d|%d|%d)\n",
-			__func__, width, height, bytesperline);
-		return -EINVAL;
-	}
-	if (bytesperline & 3) {
-		pci_err(zr->pci_dev, "%s - bytesperline (%d) must be 4-byte aligned\n",
-			__func__, bytesperline);
-		return -EINVAL;
-	}
-
-	zr->vbuf_base = (void *)((unsigned long)base & ~3);
-	zr->vbuf_height = height;
-	zr->vbuf_width = width;
-	zr->vbuf_depth = fmt->depth;
-	zr->vbuf_bytesperline = bytesperline;
-
-	return 0;
-}
-
 /* get the status of a buffer in the clients buffer queue */
 static int zoran_v4l2_buffer_status(struct zoran_fh *fh,
 				    struct v4l2_buffer *buf, int num)
@@ -1403,47 +1361,6 @@ static int zoran_s_fmt_vid_cap(struct file *file, void *__fh,
 	return res;
 }
 
-static int zoran_g_fbuf(struct file *file, void *__fh,
-			struct v4l2_framebuffer *fb)
-{
-	struct zoran *zr = video_drvdata(file);
-
-	memset(fb, 0, sizeof(*fb));
-	fb->base = zr->vbuf_base;
-	fb->fmt.width = zr->vbuf_width;
-	fb->fmt.height = zr->vbuf_height;
-	fb->fmt.bytesperline = zr->vbuf_bytesperline;
-	fb->fmt.colorspace = V4L2_COLORSPACE_SRGB;
-	fb->fmt.field = V4L2_FIELD_INTERLACED;
-	fb->capability = V4L2_FBUF_CAP_LIST_CLIPPING;
-
-	return 0;
-}
-
-static int zoran_s_fbuf(struct file *file, void *__fh,
-			const struct v4l2_framebuffer *fb)
-{
-	struct zoran *zr = video_drvdata(file);
-	struct zoran_fh *fh = __fh;
-	int i, res = 0;
-	__le32 printformat = __cpu_to_le32(fb->fmt.pixelformat);
-
-	for (i = 0; i < NUM_FORMATS; i++)
-		if (zoran_formats[i].fourcc == fb->fmt.pixelformat)
-			break;
-	if (i == NUM_FORMATS) {
-		pci_err(zr->pci_dev, "VIDIOC_S_FBUF - format=0x%x (%4.4s) not allowed\n",
-			fb->fmt.pixelformat,
-			(char *)&printformat);
-		return -EINVAL;
-	}
-
-	res = setup_fbuffer(fh, fb->base, &zoran_formats[i], fb->fmt.width,
-			    fb->fmt.height, fb->fmt.bytesperline);
-
-	return res;
-}
-
 static int zoran_streamoff(struct file *file, void *__fh, enum v4l2_buf_type type);
 
 static int zoran_reqbufs(struct file *file, void *__fh, struct v4l2_requestbuffers *req)
@@ -2235,8 +2152,6 @@ static const struct v4l2_ioctl_ops zoran_ioctl_ops = {
 /*	.vidioc_enum_output		    = zoran_enum_output,
 	.vidioc_g_output		    = zoran_g_output,
 	.vidioc_s_output		    = zoran_s_output,*/
-	.vidioc_g_fbuf			    = zoran_g_fbuf,
-	.vidioc_s_fbuf			    = zoran_s_fbuf,
 	.vidioc_g_std			    = zoran_g_std,
 	.vidioc_s_std			    = zoran_s_std,
 	.vidioc_g_jpegcomp		    = zoran_g_jpegcomp,
-- 
2.26.2


  parent reply	other threads:[~2020-09-25 18:35 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-25 18:30 [PATCH RFT/RFC v2 00/47] staging: media: bring back zoran driver Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 01/47] staging: media: Revert "media: zoran: remove deprecated driver" Corentin Labbe
     [not found]   ` <CA+QCeVRjnU6RwHkj3c54pzLq6yeaZ1Lz8eG4vDOkGT5RyKvJhA@mail.gmail.com>
2022-05-07 16:11     ` Laurent Pinchart
2020-09-25 18:30 ` [PATCH RFT/RFC v2 02/47] MAINTAINERS: change maintainer of the zoran driver Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 03/47] staging: media: zoran: datasheet is no longer available from zoran.com Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 04/47] staging: media: zoran: Documentation: fix typo Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 05/47] staging: media: zoran: fix checkpatch issue Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 06/47] staging: media: zoran: do not forward declare zr36057_init_vfe Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 07/47] staging: media: zoran: convert all error dprintk to pci_err/pr_err Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 08/47] staging: media: zoran: convert dprintk warn Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 09/47] staging: media: zoran: convert dprintk info to pci_info Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 10/47] staging: media: zoran: convert dprintk debug Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 11/47] staging: media: zoran: zoran_device.c: convert pr_x to pci_x Corentin Labbe
2020-09-25 18:36   ` Joe Perches
2020-09-25 18:30 ` [PATCH RFT/RFC v2 12/47] staging: media: zoran: remove proc_fs Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 13/47] staging: media: zoran: use VFL_TYPE_VIDEO Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 14/47] staging: media: zoran: use v4l2_buffer_set_timestamp Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 15/47] staging: media: zoran: do not print random guest 0 Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 16/47] staging: media: zoran: move buffer_size out of zoran_fh Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 17/47] staging: media: zoran: move v4l_settings " Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 18/47] staging: media: zoran: move jpg_settings " Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 19/47] staging: media: zoran: move overlay_settings " Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 20/47] staging: media: zoran: Use video_drvdata to get struct zoran Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 21/47] staging: media: zoran: Change zoran_v4l_set_format parameter from zoran_fh to zoran Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 22/47] staging: media: zoran: remove overlay Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 23/47] staging: media: zoran: Use DMA coherent for stat_com Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 24/47] staging: media: zoran: use ZR_NORM Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 25/47] staging: media: zoran: zoran does not support STD_ALL Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 26/47] staging: media: zoran: convert irq to pci irq Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 27/47] staging: media: zoran: convert zoran alloc to devm Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 28/47] staging: media: zoran: convert mdelay to udelay Corentin Labbe
2020-10-01  7:54   ` Mauro Carvalho Chehab
2020-09-25 18:30 ` [PATCH RFT/RFC v2 29/47] staging: media: zoran: use devm for videocodec_master alloc Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 30/47] staging: media: zoran: use pci_request_regions Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 31/47] staging: media: zoran: use devm_ioremap Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 32/47] staging: media: zoran: add stat_com buffer Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 33/47] staging: media: zoran: constify struct tvnorm Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 34/47] staging: media: zoran: constify codec_name Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 35/47] staging: media: zoran: Add more check for compliance Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 36/47] staging: media: zoran: Add vb_queue Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 37/47] staging: media: zoran: disable output Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 38/47] staging: media: zoran: device support only 32bit DMA address Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 39/47] staging: media: zoran: enable makefile Corentin Labbe
2020-09-25 18:30 ` Corentin Labbe [this message]
2020-09-25 18:30 ` [PATCH RFT/RFC v2 41/47] staging: media: zoran: add vidioc_g_parm Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 42/47] staging: media: zoran: remove test_interrupts Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 43/47] staging: media: zoran: fix use of buffer_size and sizeimage Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 44/47] staging: media: zoran: fix some compliance test Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 45/47] staging: media: zoran: remove deprecated .vidioc_g_jpegcomp Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 46/47] staging: media: zoran: convert to vb2 Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 47/47] staging: media: zoran: update TODO Corentin Labbe
2020-09-28 13:45 ` [PATCH RFT/RFC v2 00/47] staging: media: bring back zoran driver Hans Verkuil
2020-09-28 13:53   ` Laurent Pinchart
2020-09-28 14:01     ` Hans Verkuil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1601058657-14042-41-git-send-email-clabbe@baylibre.com \
    --to=clabbe@baylibre.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hverkuil@xs4all.nl \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox