Skip to contentSkip to conversation

V4L/DVB: v4l: document new Bayer and monochrome pixel formats

PATCH In review Mauro Carvalho Chehab 2 participants 4 messages Feb 25, 2010 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): c541522de5dec33a56dbe94a26fadf400fd7e536.1267119175.git.mchehab@redhat.com

#1 lore raw

PATCH v2 2/4 DocBook: Add rules to auto-generate some media docbooks

There are some files that are automatically generated by the old subsystem Makefile. Move those rules to kernel DocBook Makefile, in order to autogenerate the media cross-reference files:

	media-entities.tmpl
	media-indices.tmpl
	dvb/frontend.h.xml
	v4l/videodev2.h.xml

Fix makefile

 delete mode 100644 Documentation/DocBook/dvb/frontend.h.xml
 delete mode 100644 Documentation/DocBook/media-entities.tmpl
 delete mode 100644 Documentation/DocBook/media-indices.tmpl
 delete mode 100644 Documentation/DocBook/v4l/videodev2.h.xml
Documentation/DocBook/Makefile +504 -20
index 7c590ef..36068db 100644
@@ -6,6 +6,8 @@
 # To add a new book the only step required is to add the book to the
 # list of DOCBOOKS.
 
+TMPMEDIA=.tmpmedia
+
 DOCBOOKS := z8530book.xml mcabook.xml device-drivers.xml \
 	    kernel-hacking.xml kernel-locking.xml deviceiobook.xml \
 	    writing_usb_driver.xml networking.xml \
@@ -14,7 +16,7 @@ DOCBOOKS := z8530book.xml mcabook.xml device-drivers.xml \
 	    genericirq.xml s390-drivers.xml uio-howto.xml scsi.xml \
 	    mac80211.xml debugobjects.xml sh.xml regulator.xml \
 	    alsa-driver-api.xml writing-an-alsa-driver.xml \
-	    tracepoint.xml media.xml
+	    tracepoint.xml $(TMPMEDIA)/media.xml
 
 ###
 # The build process is as follows (targets):
@@ -32,10 +34,10 @@ PS_METHOD	= $(prefer-db2x)
 
 ###
 # The targets that may be used.
-PHONY += xmldocs sgmldocs psdocs pdfdocs htmldocs mandocs installmandocs cleandocs xmldoclinks
+PHONY += xmldocs sgmldocs psdocs pdfdocs htmldocs mandocs installmandocs cleandocs mediaprep
 
 BOOKS := $(addprefix $(obj)/,$(DOCBOOKS))
-xmldocs: $(BOOKS) xmldoclinks
+xmldocs: $(BOOKS)
 sgmldocs: xmldocs
 
 PS := $(patsubst %.xml, %.ps, $(BOOKS))
@@ -47,24 +49,11 @@ pdfdocs: $(PDF)
 HTML := $(sort $(patsubst %.xml, %.html, $(BOOKS)))
 htmldocs: $(HTML)
 	@$($(quiet)cmd_build_main_index)
-	@$($(call build_main_index))
-	@($(call build_images))
+	@($(call build_main_index))
 
 MAN := $(patsubst %.xml, %.9, $(BOOKS))
 mandocs: $(MAN)
 
-build_images = mkdir -p $(objtree)/Documentation/DocBook/media/ && \
-	       cp $(srctree)/Documentation/DocBook/dvb/*.png $(srctree)/Documentation/DocBook/v4l/*.gif $(objtree)/Documentation/DocBook/media/
-
-xmldoclinks:
-ifneq ($(objtree),$(srctree))
-	for dep in dvb media-entities.tmpl media-indices.tmpl v4l; do \
-		rm -f $(objtree)/Documentation/DocBook/$$dep \
-		&& ln -s $(srctree)/Documentation/DocBook/$$dep $(objtree)/Documentation/DocBook/ \
-		|| exit; \
-	done
-endif
-
 installmandocs: mandocs
 	mkdir -p /usr/local/man/man9/
 	install Documentation/DocBook/man/*.9.gz /usr/local/man/man9/
@@ -100,7 +89,7 @@ endef
 	$(call if_changed_rule,docproc)
 
 ###
-#Read in all saved dependency files 
+#Read in all saved dependency files
 cmd_files := $(wildcard $(foreach f,$(BOOKS),$(dir $(f)).$(notdir $(f)).cmd))
 
 ifneq ($(cmd_files),)
@@ -151,7 +140,7 @@ quiet_cmd_build_main_index = echo '  BUILD   $@'
 
 index = index.html
 main_idx = Documentation/DocBook/$(index)
-build_main_index = rm -rf $(main_idx) && \
+build_main_index = rm -rf $(main_idx); \
 		   echo '<h1>Linux Kernel HTML Documentation</h1>' >> $(main_idx) && \
 		   echo '<h2>Kernel Version: $(KERNELVERSION)</h2>' >> $(main_idx) && \
 		   cat $(HTML) >> $(main_idx)
@@ -241,7 +230,7 @@ clean-files := $(DOCBOOKS) \
 	$(patsubst %.xml, %.9,    $(DOCBOOKS)) \
 	$(index)
 
-clean-dirs := $(patsubst %.xml,%,$(DOCBOOKS)) man
+clean-dirs := $(patsubst %.xml,%,$(DOCBOOKS)) man $(MEDIADIR)
 
 cleandocs:
 	$(Q)rm -f $(call objectify, $(clean-files))
@@ -251,3 +240,498 @@ cleandocs:
 # information in a variable se we can use it in if_changed and friends.
 
 .PHONY: $(PHONY)
+
+
+#
+# Media build rules - Auto-generates media contents/indexes and *.h xml's
+#
+
+SHELL=/bin/bash
+
+MEDIA_DIR=$(objtree)/Documentation/DocBook/$(TMPMEDIA)
+
+V4L_SGMLS = \
+	biblio.xml \
+	common.xml \
+	compat.xml \
+	controls.xml \
+	dev-capture.xml \
+	dev-codec.xml \
+	dev-effect.xml \
+	dev-osd.xml \
+	dev-output.xml \
+	dev-overlay.xml \
+	dev-radio.xml \
+	dev-raw-vbi.xml \
+	dev-rds.xml \
+	dev-sliced-vbi.xml \
+	dev-teletext.xml \
+	driver.xml \
+	libv4l.xml \
+	remote_controllers.xml \
+	fdl-appendix.xml \
+	func-close.xml \
+	func-ioctl.xml \
+	func-mmap.xml \
+	func-munmap.xml \
+	func-open.xml \
+	func-poll.xml \
+	func-read.xml \
+	func-select.xml \
+	func-write.xml \
+	io.xml \
+	pixfmt-grey.xml \
+	pixfmt-nv12.xml \
+	pixfmt-nv16.xml \
+	pixfmt-packed-rgb.xml \
+	pixfmt-packed-yuv.xml \
+	pixfmt-sbggr16.xml \
+	pixfmt-sbggr8.xml \
+	pixfmt-sgbrg8.xml \
+	pixfmt-sgrbg8.xml \
+	pixfmt-uyvy.xml \
+	pixfmt-vyuy.xml \
+	pixfmt-y16.xml \
+	pixfmt-y41p.xml \
+	pixfmt-yuv410.xml \
+	pixfmt-yuv411p.xml \
+	pixfmt-yuv420.xml \
+	pixfmt-yuv422p.xml \
+	pixfmt-yuyv.xml \
+	pixfmt-yvyu.xml \
+	pixfmt-srggb10.xml \
+	pixfmt-srggb8.xml \
+	pixfmt-y10.xml \
+	pixfmt.xml \
+	vidioc-cropcap.xml \
+	vidioc-dbg-g-register.xml \
+	vidioc-encoder-cmd.xml \
+	vidioc-enum-fmt.xml \
+	vidioc-enum-frameintervals.xml \
+	vidioc-enum-framesizes.xml \
+	vidioc-enumaudio.xml \
+	vidioc-enumaudioout.xml \
+	vidioc-enuminput.xml \
+	vidioc-enumoutput.xml \
+	vidioc-enum-dv-presets.xml \
+	vidioc-g-dv-preset.xml \
+	vidioc-query-dv-preset.xml \
+	vidioc-g-dv-timings.xml \
+	vidioc-enumstd.xml \
+	vidioc-g-audio.xml \
+	vidioc-g-audioout.xml \
+	vidioc-dbg-g-chip-ident.xml \
+	vidioc-g-crop.xml \
+	vidioc-g-ctrl.xml \
+	vidioc-g-enc-index.xml \
+	vidioc-g-ext-ctrls.xml \
+	vidioc-g-fbuf.xml \
+	vidioc-g-fmt.xml \
+	vidioc-g-frequency.xml \
+	vidioc-g-input.xml \
+	vidioc-g-jpegcomp.xml \
+	vidioc-g-modulator.xml \
+	vidioc-g-output.xml \
+	vidioc-g-parm.xml \
+	vidioc-g-priority.xml \
+	vidioc-g-sliced-vbi-cap.xml \
+	vidioc-g-std.xml \
+	vidioc-g-tuner.xml \
+	vidioc-log-status.xml \
+	vidioc-overlay.xml \
+	vidioc-qbuf.xml \
+	vidioc-querybuf.xml \
+	vidioc-querycap.xml \
+	vidioc-queryctrl.xml \
+	vidioc-querystd.xml \
+	vidioc-reqbufs.xml \
+	vidioc-s-hw-freq-seek.xml \
+	vidioc-streamon.xml \
+	capture.c.xml \
+	keytable.c.xml \
+	v4l2grab.c.xml \
+	videodev2.h.xml \
+	v4l2.xml
+
+DVB_SGMLS = \
+	intro.xml \
+	frontend.xml \
+	dvbproperty.xml \
+	demux.xml \
+	video.xml \
+	audio.xml \
+	ca.xml \
+	net.xml \
+	kdapi.xml \
+	examples.xml \
+	frontend.h.xml \
+	dvbapi.xml
+
+MEDIA_SGMLS =   $(addprefix ./,$(V4L_SGMLS)) $(addprefix ./,$(DVB_SGMLS)) $(addprefix ./,$(MEDIA_TEMP))
+
+MEDIA_TEMP =  media-entities.tmpl \
+	      media-indices.tmpl \
+	      videodev2.h.xml \
+	      frontend.h.xml
+
+MEDIA_TEMP_OBJ := $(addprefix $(MEDIA_DIR)/,$(MEDIA_TEMP))
+
+FUNCS = \
+	close \
+	ioctl \
+	mmap \
+	munmap \
+	open \
+	poll \
+	read \
+	select \
+	write \
+
+IOCTLS = \
+	VIDIOC_CROPCAP \
+	VIDIOC_DBG_G_CHIP_IDENT \
+	VIDIOC_DBG_G_REGISTER \
+	VIDIOC_DBG_S_REGISTER \
+	VIDIOC_DQBUF \
+	VIDIOC_ENCODER_CMD \
+	VIDIOC_ENUMAUDIO \
+	VIDIOC_ENUMAUDOUT \
+	VIDIOC_ENUMINPUT \
+	VIDIOC_ENUMOUTPUT \
+	VIDIOC_ENUMSTD \
+	VIDIOC_ENUM_DV_PRESETS \
+	VIDIOC_ENUM_FMT \
+	VIDIOC_ENUM_FRAMEINTERVALS \
+	VIDIOC_ENUM_FRAMESIZES \
+	VIDIOC_G_AUDIO \
+	VIDIOC_G_AUDOUT \
+	VIDIOC_G_CROP \
+	VIDIOC_G_CTRL \
+	VIDIOC_G_DV_PRESET \
+	VIDIOC_G_DV_TIMINGS \
+	VIDIOC_G_ENC_INDEX \
+	VIDIOC_G_EXT_CTRLS \
+	VIDIOC_G_FBUF \
+	VIDIOC_G_FMT \
+	VIDIOC_G_FREQUENCY \
+	VIDIOC_G_INPUT \
+	VIDIOC_G_JPEGCOMP \
+	VIDIOC_G_MPEGCOMP \
+	VIDIOC_G_MODULATOR \
+	VIDIOC_G_OUTPUT \
+	VIDIOC_G_PARM \
+	VIDIOC_G_PRIORITY \
+	VIDIOC_G_SLICED_VBI_CAP \
+	VIDIOC_G_STD \
+	VIDIOC_G_TUNER \
+	VIDIOC_LOG_STATUS \
+	VIDIOC_OVERLAY \
+	VIDIOC_QBUF \
+	VIDIOC_QUERYBUF \
+	VIDIOC_QUERYCAP \
+	VIDIOC_QUERYCTRL \
+	VIDIOC_QUERYMENU \
+	VIDIOC_QUERYSTD \
+	VIDIOC_QUERY_DV_PRESET \
+	VIDIOC_REQBUFS \
+	VIDIOC_STREAMOFF \
+	VIDIOC_STREAMON \
+	VIDIOC_S_AUDIO \
+	VIDIOC_S_AUDOUT \
+	VIDIOC_S_CROP \
+	VIDIOC_S_CTRL \
+	VIDIOC_S_DV_PRESET \
+	VIDIOC_S_DV_TIMINGS \
+	VIDIOC_S_EXT_CTRLS \
+	VIDIOC_S_FBUF \
+	VIDIOC_S_FMT \
+	VIDIOC_S_FREQUENCY \
+	VIDIOC_S_HW_FREQ_SEEK \
+	VIDIOC_S_INPUT \
+	VIDIOC_S_JPEGCOMP \
+	VIDIOC_S_MPEGCOMP \
+	VIDIOC_S_MODULATOR \
+	VIDIOC_S_OUTPUT \
+	VIDIOC_S_PARM \
+	VIDIOC_S_PRIORITY \
+	VIDIOC_S_STD \
+	VIDIOC_S_TUNER \
+	VIDIOC_TRY_ENCODER_CMD \
+	VIDIOC_TRY_EXT_CTRLS \
+	VIDIOC_TRY_FMT \
+
+TYPES = \
+	v4l2_std_id \
+
+ENUMS = \
+	v4l2_buf_type \
+	v4l2_colorspace \
+	v4l2_ctrl_type \
+	v4l2_exposure_auto_type \
+	v4l2_field \
+	v4l2_frmivaltypes \
+	v4l2_frmsizetypes \
+	v4l2_memory \
+	v4l2_mpeg_audio_ac3_bitrate \
+	v4l2_mpeg_audio_crc \
+	v4l2_mpeg_audio_emphasis \
+	v4l2_mpeg_audio_encoding \
+	v4l2_mpeg_audio_l1_bitrate \
+	v4l2_mpeg_audio_l2_bitrate \
+	v4l2_mpeg_audio_l3_bitrate \
+	v4l2_mpeg_audio_mode \
+	v4l2_mpeg_audio_mode_extension \
+	v4l2_mpeg_audio_sampling_freq \
+	v4l2_mpeg_cx2341x_video_chroma_spatial_filter_type \
+	v4l2_mpeg_cx2341x_video_luma_spatial_filter_type \
+	v4l2_mpeg_cx2341x_video_median_filter_type \
+	v4l2_mpeg_cx2341x_video_spatial_filter_mode \
+	v4l2_mpeg_cx2341x_video_temporal_filter_mode \
+	v4l2_mpeg_stream_type \
+	v4l2_mpeg_stream_vbi_fmt \
+	v4l2_mpeg_video_aspect \
+	v4l2_mpeg_video_bitrate_mode \
+	v4l2_mpeg_video_encoding \
+	v4l2_power_line_frequency \
+	v4l2_priority \
+	v4l2_tuner_type \
+	v4l2_preemphasis \
+
+STRUCTS = \
+	v4l2_audio \
+	v4l2_audioout \
+	v4l2_bt_timings \
+	v4l2_buffer \
+	v4l2_capability \
+	v4l2_captureparm \
+	v4l2_clip \
+	v4l2_control \
+	v4l2_crop \
+	v4l2_cropcap \
+	v4l2_dbg_chip_ident \
+	v4l2_dbg_match \
+	v4l2_dbg_register \
+	v4l2_dv_enum_preset \
+	v4l2_dv_preset \
+	v4l2_dv_timings \
+	v4l2_enc_idx \
+	v4l2_enc_idx_entry \
+	v4l2_encoder_cmd \
+	v4l2_ext_control \
+	v4l2_ext_controls \
+	v4l2_fmtdesc \
+	v4l2_format \
+	v4l2_fract \
+	v4l2_framebuffer \
+	v4l2_frequency \
+	v4l2_frmival_stepwise \
+	v4l2_frmivalenum \
+	v4l2_frmsize_discrete \
+	v4l2_frmsize_stepwise \
+	v4l2_frmsizeenum \
+	v4l2_hw_freq_seek \
+	v4l2_input \
+	v4l2_jpegcompression \
+	v4l2_modulator \
+	v4l2_mpeg_vbi_fmt_ivtv \
+	v4l2_output \
+	v4l2_outputparm \
+	v4l2_pix_format \
+	v4l2_queryctrl \
+	v4l2_querymenu \
+	v4l2_rect \
+	v4l2_requestbuffers \
+	v4l2_sliced_vbi_cap \
+	v4l2_sliced_vbi_data \
+	v4l2_sliced_vbi_format \
+	v4l2_standard \
+	v4l2_streamparm \
+	v4l2_timecode \
+	v4l2_tuner \
+	v4l2_vbi_format \
+	v4l2_window \
+
+ERRORS = \
+	EACCES \
+	EAGAIN \
+	EBADF \
+	EBUSY \
+	EFAULT \
+	EIO \
+	EINTR \
+	EINVAL \
+	ENFILE \
+	ENOMEM \
+	ENOSPC \
+	ENOTTY \
+	ENXIO \
+	EMFILE \
+	EPERM \
+	ERANGE \
+
+ESCAPE = \
+	-e "s/&/\\&amp;/g" \
+	-e "s/</\\&lt;/g" \
+	-e "s/>/\\&gt;/g"
+
+FILENAME = \
+	-e s,"^[^\/]*/",, \
+	-e s/"\\.xml"// \
+	-e s/"\\.tmpl"// \
+	-e s/\\\./-/g \
+	-e s/"^func-"// \
+	-e s/"^pixfmt-"// \
+	-e s/"^vidioc-"//
+
+# Generate references to these structs in videodev2.h.xml.
+DOCUMENTED = \
+	-e "s/\(enum *\)v4l2_mpeg_cx2341x_video_\([a-z]*_spatial_filter_type\)/\1<link linkend=\"\2\">v4l2_mpeg_cx2341x_video_\2<\/link>/g" \
+	-e "s/\(\(enum\|struct\) *\)\(v4l2_[a-zA-Z0-9_]*\)/\1<link linkend=\"\3\">\3<\/link>/g" \
+	-e "s/\(V4L2_PIX_FMT_[A-Z0-9_]\+\) /<link linkend=\"\1\">\1<\/link> /g" \
+	-e ":a;s/\(linkend=\".*\)_\(.*\">\)/\1-\2/;ta" \
+	-e "s/\(linkend\=\"\)v4l2\-mpeg\-vbi\-ITV0/\1v4l2-mpeg-vbi-itv0-1/g"
+
+DVB_DOCUMENTED = \
+	-e "s,\(define \)\([A-Z0-9_]\+\)\(\s\+_IO\),\1\<link linkend=\"\2\">\2\<\/link\>\3,g" \
+	-e "s/\(linkend\=\"\)FE_SET_PROPERTY/\1FE_GET_PROPERTY/g"
+
+
+#
+# Media targets and dependencies
+#
+
+$(obj)/$(TMPMEDIA)/media.xml: $(obj)/media.tmpl $(MEDIA_TEMP_OBJ) FORCE
+	$(call if_changed_rule,docproc)
+
+$(MEDIA_DIR)/v4l2.xml:
+	@$($(quiet)gen_xml)
+	@(mkdir -p $(MEDIA_DIR))
+	@(cp $(srctree)/Documentation/DocBook/dvb/*.png $(srctree)/Documentation/DocBook/v4l/*.gif $(MEDIA_DIR)/)
+	@(ln -sf $(srctree)/Documentation/DocBook/v4l/*xml $(MEDIA_DIR)/)
+	@(ln -sf $(srctree)/Documentation/DocBook/dvb/*xml $(MEDIA_DIR)/)
+
+$(MEDIA_DIR)/videodev2.h.xml: $(srctree)/include/linux/videodev2.h $(MEDIA_DIR)/v4l2.xml
+	@$($(quiet)gen_xml)
+	@(					\
+	echo "<programlisting>") > $@
+	@(					\
+	expand --tabs=8 < $< |			\
+	  sed $(ESCAPE) $(DOCUMENTED) |		\
+	  sed 's/i\.e\./&ie;/') >> $@
+	@(					\
+	echo "</programlisting>") >> $@
+
+$(MEDIA_DIR)/frontend.h.xml: $(srctree)/include/linux/dvb/frontend.h $(MEDIA_DIR)/v4l2.xml
+	@$($(quiet)gen_xml)
+	@(					\
+	echo "<programlisting>") > $@
+	@(					\
+	expand --tabs=8 < $< |			\
+	  sed $(ESCAPE) $(DVB_DOCUMENTED) |	\
+	  sed 's/i\.e\./&ie;/') >> $@
+	@(					\
+	echo "</programlisting>") >> $@
+
+$(MEDIA_DIR)/media-entities.tmpl: $(MEDIA_DIR)/v4l2.xml
+	@$($(quiet)gen_xml)
+	@(								\
+	echo "<!-- Generated file! Do not edit. -->") >$@
+	@(								\
+	echo -e "\n<!-- Functions -->") >>$@
+	@(								\
+	for ident in $(FUNCS) ; do					\
+	  entity=`echo $$ident | tr _ -` ;				\
+	  echo "<!ENTITY func-$$entity \"<link"				\
+	    "linkend='func-$$entity'><function>$$ident()</function></link>\">" \
+	  >>$@ ;							\
+	done)
+	@(								\
+	echo -e "\n<!-- Ioctls -->") >>$@
+	@(								\
+	for ident in $(IOCTLS) ; do					\
+	  entity=`echo $$ident | tr _ -` ;				\
+	  id=`grep "<refname>$$ident" $(MEDIA_DIR)/vidioc-*.xml | sed -r s,"^.*/(.*).xml.*","\1",` ; \
+	  echo "<!ENTITY $$entity \"<link"				\
+	    "linkend='$$id'><constant>$$ident</constant></link>\">"	\
+	  >>$@ ;							\
+	done)
+	@(								\
+	echo -e "\n<!-- Types -->") >>$@
+	@(								\
+	for ident in $(TYPES) ; do					\
+	  entity=`echo $$ident | tr _ -` ;				\
+	  echo "<!ENTITY $$entity \"<link"				\
+	    "linkend='$$entity'>$$ident</link>\">" >>$@ ;		\
+	done)
+	@(								\
+	echo -e "\n<!-- Enums -->") >>$@
+	@(								\
+	for ident in $(ENUMS) ; do					\
+	  entity=`echo $$ident | sed -e "s/v4l2_mpeg_cx2341x_video_\([a-z]*_spatial_filter_type\)/\1/" | tr _ -` ; \
+	  echo "<!ENTITY $$entity \"enum&nbsp;<link"			\
+	    "linkend='$$entity'>$$ident</link>\">" >>$@ ;		\
+	done)
+	@(								\
+	echo -e "\n<!-- Structures -->") >>$@
+	@(								\
+	for ident in $(STRUCTS) ; do					\
+	  entity=`echo $$ident | tr _ -` ;				\
+	  echo "<!ENTITY $$entity \"struct&nbsp;<link"			\
+	    "linkend='$$entity'>$$ident</link>\">" >>$@ ;		\
+	done)
+	@(								\
+	echo -e "\n<!-- Error Codes -->") >>$@
+	@(								\
+	for ident in $(ERRORS) ; do					\
+	  echo "<!ENTITY $$ident \"<errorcode>$$ident</errorcode>"	\
+	    "error code\">" >>$@ ;					\
+	done)
+	@(								\
+	echo -e "\n<!-- Subsections -->") >>$@
+	@(								\
+	for file in $(MEDIA_SGMLS) ; do					\
+	  entity=`echo "$$file" | sed $(FILENAME) -e s/"^([^-]*)"/sub\1/` ; \
+	  if ! echo "$$file" |						\
+	    grep -q -E -e '^(func|vidioc|pixfmt)-' ; then		\
+	    echo "<!ENTITY sub-$$entity SYSTEM \"./$$file\">" >>$@ ;	\
+	  fi ;								\
+	done)
+	@(								\
+	echo -e "\n<!-- Function Reference -->") >>$@
+	@(								\
+	for file in $(MEDIA_SGMLS) ; do					\
+	  if echo "$$file" |						\
+	    grep -q -E -e '(func|vidioc|pixfmt)-' ; then		\
+	    entity=`echo "$$file" |sed $(FILENAME)` ;			\
+	    echo "<!ENTITY $$entity SYSTEM \"./$$file\">" >>$@ ;	\
+	  fi ;								\
+	done)
+
+# Jade can auto-generate a list-of-tables, which includes all structs,
+# but we only want data types, all types, and sorted please.
+$(MEDIA_DIR)/media-indices.tmpl: $(MEDIA_DIR)/v4l2.xml
+	@$($(quiet)gen_xml)
+	@(								\
+	echo "<!-- Generated file! Do not edit. -->") >$@
+	@(								\
+	echo -e "\n<index><title>List of Types</title>") >>$@
+	@(								\
+	for ident in $(TYPES) ; do					\
+	  id=`echo $$ident | tr _ -` ;					\
+	  echo "<indexentry><primaryie><link"				\
+	    "linkend='$$id'>$$ident</link></primaryie></indexentry>" >>$@ ; \
+	done)
+	@(								\
+	for ident in $(ENUMS) ; do					\
+	  id=`echo $$ident | sed -e "s/v4l2_mpeg_cx2341x_video_\([a-z]*_spatial_filter_type\)/\1/" | tr _ -`; \
+	  echo "<indexentry><primaryie>enum&nbsp;<link"			\
+	    "linkend='$$id'>$$ident</link></primaryie></indexentry>" >>$@ ; \
+	done)
+	@(								\
+	for ident in $(STRUCTS) ; do					\
+	  id=`echo $$ident | tr _ -` ;					\
+	  echo "<indexentry><primaryie>struct&nbsp;<link"		\
+	    "linkend='$$id'>$$ident</link></primaryie></indexentry>" >>$@ ; \
+	done)
+	@(								\
+	echo "</index>") >>$@
Documentation/DocBook/dvb/frontend.h.xml deleted +0 -415

415 lines not on this page · raw message

Documentation/DocBook/media-entities.tmpl deleted +0 -383

383 lines not on this page · raw message

Documentation/DocBook/media-indices.tmpl deleted +0 -89

89 lines not on this page · raw message

Documentation/DocBook/v4l/videodev2.h.xml deleted +0 -1757

1,538 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
1.6.6.1

Part of the diff is not shown here. View the raw message.

#2 lore raw

Re: [PATCHv2 2/4] DocBook: Add rules to auto-generate some media docbooks

Quoted 110 lines · Mauro Carvalho Chehab

There are some files that are automatically generated by the old subsystem Makefile. Move those rules to kernel DocBook Makefile, in order to autogenerate the media cross-reference files:

	media-entities.tmpl
	media-indices.tmpl
	dvb/frontend.h.xml
	v4l/videodev2.h.xml

Fix makefile

 delete mode 100644 Documentation/DocBook/dvb/frontend.h.xml
 delete mode 100644 Documentation/DocBook/media-entities.tmpl
 delete mode 100644 Documentation/DocBook/media-indices.tmpl
 delete mode 100644 Documentation/DocBook/v4l/videodev2.h.xml
Documentation/DocBook/Makefile +9 -20
index 7c590ef..36068db 100644
@@ -6,6 +6,8 @@
 # To add a new book the only step required is to add the book to the
 # list of DOCBOOKS.
 
+TMPMEDIA=.tmpmedia
+
 DOCBOOKS := z8530book.xml mcabook.xml device-drivers.xml \
 	    kernel-hacking.xml kernel-locking.xml deviceiobook.xml \
 	    writing_usb_driver.xml networking.xml \
@@ -14,7 +16,7 @@ DOCBOOKS := z8530book.xml mcabook.xml device-drivers.xml \
 	    genericirq.xml s390-drivers.xml uio-howto.xml scsi.xml \
 	    mac80211.xml debugobjects.xml sh.xml regulator.xml \
 	    alsa-driver-api.xml writing-an-alsa-driver.xml \
-	    tracepoint.xml media.xml
+	    tracepoint.xml $(TMPMEDIA)/media.xml
 
 ###
 # The build process is as follows (targets):
@@ -32,10 +34,10 @@ PS_METHOD	= $(prefer-db2x)
 
 ###
 # The targets that may be used.
-PHONY += xmldocs sgmldocs psdocs pdfdocs htmldocs mandocs installmandocs cleandocs xmldoclinks
+PHONY += xmldocs sgmldocs psdocs pdfdocs htmldocs mandocs installmandocs cleandocs mediaprep
 
 BOOKS := $(addprefix $(obj)/,$(DOCBOOKS))
-xmldocs: $(BOOKS) xmldoclinks
+xmldocs: $(BOOKS)
 sgmldocs: xmldocs
 
 PS := $(patsubst %.xml, %.ps, $(BOOKS))
@@ -47,24 +49,11 @@ pdfdocs: $(PDF)
 HTML := $(sort $(patsubst %.xml, %.html, $(BOOKS)))
 htmldocs: $(HTML)
 	@$($(quiet)cmd_build_main_index)
-	@$($(call build_main_index))
-	@($(call build_images))
+	@($(call build_main_index))
 
 MAN := $(patsubst %.xml, %.9, $(BOOKS))
 mandocs: $(MAN)
 
-build_images = mkdir -p $(objtree)/Documentation/DocBook/media/ && \
-	       cp $(srctree)/Documentation/DocBook/dvb/*.png $(srctree)/Documentation/DocBook/v4l/*.gif $(objtree)/Documentation/DocBook/media/
-
-xmldoclinks:
-ifneq ($(objtree),$(srctree))
-	for dep in dvb media-entities.tmpl media-indices.tmpl v4l; do \
-		rm -f $(objtree)/Documentation/DocBook/$$dep \
-		&& ln -s $(srctree)/Documentation/DocBook/$$dep $(objtree)/Documentation/DocBook/ \
-		|| exit; \
-	done
-endif
-
 installmandocs: mandocs
 	mkdir -p /usr/local/man/man9/
 	install Documentation/DocBook/man/*.9.gz /usr/local/man/man9/
@@ -100,7 +89,7 @@ endef
 	$(call if_changed_rule,docproc)
 
 ###
-#Read in all saved dependency files 
+#Read in all saved dependency files
 cmd_files := $(wildcard $(foreach f,$(BOOKS),$(dir $(f)).$(notdir $(f)).cmd))
 
 ifneq ($(cmd_files),)
@@ -151,7 +140,7 @@ quiet_cmd_build_main_index = echo '  BUILD   $@'
 
 index = index.html
 main_idx = Documentation/DocBook/$(index)
-build_main_index = rm -rf $(main_idx) && \
+build_main_index = rm -rf $(main_idx); \
 		   echo '<h1>Linux Kernel HTML Documentation</h1>' >> $(main_idx) && \
 		   echo '<h2>Kernel Version: $(KERNELVERSION)</h2>' >> $(main_idx) && \
 		   cat $(HTML) >> $(main_idx)
@@ -241,7 +230,7 @@ clean-files := $(DOCBOOKS) \
 	$(patsubst %.xml, %.9,    $(DOCBOOKS)) \
 	$(index)
 
-clean-dirs := $(patsubst %.xml,%,$(DOCBOOKS)) man
+clean-dirs := $(patsubst %.xml,%,$(DOCBOOKS)) man $(MEDIADIR)
 
 cleandocs:
 	$(Q)rm -f $(call objectify, $(clean-files))
@@ -251,3 +240,498 @@ cleandocs:
 # information in a variable se we can use it in if_changed and friends.
 

Documentation/DocBook/Makefile cleandocs: · line 251

Quoted 10 lines
Documentation/DocBook/Makefile +9 -0
 .PHONY: $(PHONY)
+
+
+#
+# Media build rules - Auto-generates media contents/indexes and *.h xml's
+#
+
+SHELL=/bin/bash
+
+MEDIA_DIR=$(objtree)/Documentation/DocBook/$(TMPMEDIA)

1/ The top-level html documentation index file now begins with "media". They are supposed to be in alphabetical order.
(This is minor, won't hold up the merge.)

Linux Kernel HTML Documentation
Kernel Version: 2.6.33
media

alsa-driver-api

debugobjects

device-drivers

deviceiobook

filesystems

etc.

2/ Clicking on "media" in the index list above gets a "file not found" error, I think because TMPMEDIA=.tmpmedia and it's never copied to the correct output directory.

Ah, there is a media/ dir under .tmpmedia and it contains index.html. Note quite correct directory structure there.

Well, it's better, but it's not quite ready...

Yes, when I ack the patches, you can merge them thru the media tree.

Signature · 1 line
~Randy
#3 lore raw

PATCH v2 3/4 DocBook/v4l/pixfmt.xml: Add missing formats for gspca cpia1 and sn9c2028 drivers

In reply to a message not in the archive
Documentation/DocBook/v4l/pixfmt.xml +10 -0
index 885968d..6e38f50 100644
@@ -685,6 +685,11 @@ http://www.ivtvdriver.org/</ulink></para><para>The format is documented in the
 kernel sources in the file <filename>Documentation/video4linux/cx2341x/README.hm12</filename>
 </para></entry>
 	  </row>
+	  <row id="V4L2-PIX-FMT-CPIA1">
+	    <entry><constant>V4L2_PIX_FMT_CPIA1</constant></entry>
+	    <entry>'CPIA'</entry>
+	    <entry>YUV format used by the gspca cpia1 driver.</entry>
+	  </row>
 	  <row id="V4L2-PIX-FMT-SPCA501">
 	    <entry><constant>V4L2_PIX_FMT_SPCA501</constant></entry>
 	    <entry>'S501'</entry>
@@ -770,6 +775,11 @@ kernel sources in the file <filename>Documentation/video4linux/cx2341x/README.hm
 	    <entry>'S920'</entry>
 	    <entry>YUV 4:2:0 format of the gspca sn9c20x driver.</entry>
 	  </row>
+	  <row id="V4L2-PIX-FMT-SN9C2028">
+	    <entry><constant>V4L2_PIX_FMT_SN9C2028</constant></entry>
+	    <entry>'SONX'</entry>
+	    <entry>Compressed GBRG bayer format of the gspca sn9c2028 driver.</entry>
+	  </row>
 	  <row id="V4L2-PIX-FMT-STV0680">
 	    <entry><constant>V4L2_PIX_FMT_STV0680</constant></entry>
 	    <entry>'S680'</entry>
Signature · 1 line
1.6.6.1
#4 lore raw

PATCH v2 4/4 V4L/DVB: v4l: document new Bayer and monochrome pixel formats

In reply to a message not in the archive

Document all four 10-bit Bayer formats, 10-bit monochrome and a missing 8-bit Bayer formats.

[[email protected]: remove duplicated symbol for V4L2-PIX-FMT-SGRBG10]
 create mode 100644 Documentation/DocBook/v4l/pixfmt-srggb10.xml
 create mode 100644 Documentation/DocBook/v4l/pixfmt-srggb8.xml
 create mode 100644 Documentation/DocBook/v4l/pixfmt-y10.xml
Documentation/DocBook/v4l/pixfmt-srggb10.xml new file +90 -0
new file mode 100644
index 0000000..7b27409
@@ -0,0 +1,90 @@
+    <refentry>
+      <refmeta>
+	<refentrytitle>V4L2_PIX_FMT_SRGGB10 ('RG10'),
+	 V4L2_PIX_FMT_SGRBG10 ('BA10'),
+	 V4L2_PIX_FMT_SGBRG10 ('GB10'),
+	 V4L2_PIX_FMT_SBGGR10 ('BG10'),
+	 </refentrytitle>
+	&manvol;
+      </refmeta>
+      <refnamediv>
+	<refname id="V4L2-PIX-FMT-SRGGB10"><constant>V4L2_PIX_FMT_SRGGB10</constant></refname>
+	<refname id="V4L2-PIX-FMT-SGRBG10"><constant>V4L2_PIX_FMT_SGRBG10</constant></refname>
+	<refname id="V4L2-PIX-FMT-SGBRG10"><constant>V4L2_PIX_FMT_SGBRG10</constant></refname>
+	<refname id="V4L2-PIX-FMT-SBGGR10"><constant>V4L2_PIX_FMT_SBGGR10</constant></refname>
+	<refpurpose>10-bit Bayer formats expanded to 16 bits</refpurpose>
+      </refnamediv>
+      <refsect1>
+	<title>Description</title>
+
+	<para>The following four pixel formats are raw sRGB / Bayer formats with
+10 bits per colour. Each colour component is stored in a 16-bit word, with 6
+unused high bits filled with zeros. Each n-pixel row contains n/2 green samples
+and n/2 blue or red samples, with alternating red and blue rows. Bytes are
+stored in memory in little endian order. They are conventionally described
+as GRGR... BGBG..., RGRG... GBGB..., etc. Below is an example of one of these
+formats</para>
+
+    <example>
+      <title><constant>V4L2_PIX_FMT_SBGGR10</constant> 4 &times; 4
+pixel image</title>
+
+      <formalpara>
+	<title>Byte Order.</title>
+	<para>Each cell is one byte, high 6 bits in high bytes are 0.
+	  <informaltable frame="none">
+	    <tgroup cols="5" align="center">
+	      <colspec align="left" colwidth="2*" />
+	      <tbody valign="top">
+		<row>
+		  <entry>start&nbsp;+&nbsp;0:</entry>
+		  <entry>B<subscript>00low</subscript></entry>
+		  <entry>B<subscript>00high</subscript></entry>
+		  <entry>G<subscript>01low</subscript></entry>
+		  <entry>G<subscript>01high</subscript></entry>
+		  <entry>B<subscript>02low</subscript></entry>
+		  <entry>B<subscript>02high</subscript></entry>
+		  <entry>G<subscript>03low</subscript></entry>
+		  <entry>G<subscript>03high</subscript></entry>
+		</row>
+		<row>
+		  <entry>start&nbsp;+&nbsp;8:</entry>
+		  <entry>G<subscript>10low</subscript></entry>
+		  <entry>G<subscript>10high</subscript></entry>
+		  <entry>R<subscript>11low</subscript></entry>
+		  <entry>R<subscript>11high</subscript></entry>
+		  <entry>G<subscript>12low</subscript></entry>
+		  <entry>G<subscript>12high</subscript></entry>
+		  <entry>R<subscript>13low</subscript></entry>
+		  <entry>R<subscript>13high</subscript></entry>
+		</row>
+		<row>
+		  <entry>start&nbsp;+&nbsp;16:</entry>
+		  <entry>B<subscript>20low</subscript></entry>
+		  <entry>B<subscript>20high</subscript></entry>
+		  <entry>G<subscript>21low</subscript></entry>
+		  <entry>G<subscript>21high</subscript></entry>
+		  <entry>B<subscript>22low</subscript></entry>
+		  <entry>B<subscript>22high</subscript></entry>
+		  <entry>G<subscript>23low</subscript></entry>
+		  <entry>G<subscript>23high</subscript></entry>
+		</row>
+		<row>
+		  <entry>start&nbsp;+&nbsp;24:</entry>
+		  <entry>G<subscript>30low</subscript></entry>
+		  <entry>G<subscript>30high</subscript></entry>
+		  <entry>R<subscript>31low</subscript></entry>
+		  <entry>R<subscript>31high</subscript></entry>
+		  <entry>G<subscript>32low</subscript></entry>
+		  <entry>G<subscript>32high</subscript></entry>
+		  <entry>R<subscript>33low</subscript></entry>
+		  <entry>R<subscript>33high</subscript></entry>
+		</row>
+	      </tbody>
+	    </tgroup>
+	  </informaltable>
+	</para>
+      </formalpara>
+    </example>
+  </refsect1>
+</refentry>
Documentation/DocBook/v4l/pixfmt-srggb8.xml new file +67 -0

67 lines not on this page · raw message

Documentation/DocBook/v4l/pixfmt-y10.xml new file +79 -0

79 lines not on this page · raw message

Documentation/DocBook/v4l/pixfmt.xml +3 -5
index 6e38f50..7e2c38e 100644
@@ -566,7 +566,9 @@ access the palette, this must be done with ioctls of the Linux framebuffer API.<
     &sub-sbggr8;
     &sub-sgbrg8;
     &sub-sgrbg8;
+    &sub-srggb8;
     &sub-sbggr16;
+    &sub-srggb10;
   </section>
 
   <section id="yuv-formats">
@@ -589,6 +591,7 @@ information.</para>
 
     &sub-packed-yuv;
     &sub-grey;
+    &sub-y10;
     &sub-y16;
     &sub-yuyv;
     &sub-uyvy;
@@ -710,11 +713,6 @@ kernel sources in the file <filename>Documentation/video4linux/cx2341x/README.hm
 	    <entry>'S561'</entry>
 	    <entry>Compressed GBRG Bayer format used by the gspca driver.</entry>
 	  </row>
-	  <row id="V4L2-PIX-FMT-SGRBG10">
-	    <entry><constant>V4L2_PIX_FMT_SGRBG10</constant></entry>
-	    <entry>'DA10'</entry>
-	    <entry>10 bit raw Bayer, expanded to 16 bits.</entry>
-	  </row>
 	  <row id="V4L2-PIX-FMT-SGRBG10DPCM8">
 	    <entry><constant>V4L2_PIX_FMT_SGRBG10DPCM8</constant></entry>
 	    <entry>'DB10'</entry>
Signature · 1 line
1.6.6.1