All of lore.kernel.org
 help / color / mirror / Atom feed
From: Archit Taneja <a0393947@ti.com>
To: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Archit Taneja <archit@ti.com>,
	linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org,
	rob@ti.com, sumit.semwal@ti.com
Subject: Re: [PATCH 01/23] OMAPDSS: outputs: Create a new entity called outputs
Date: Fri, 24 Aug 2012 12:53:33 +0000	[thread overview]
Message-ID: <503778E8.2060909@ti.com> (raw)
In-Reply-To: <1345812069.9287.65.camel@lappyti>

On Friday 24 August 2012 06:11 PM, Tomi Valkeinen wrote:
> On Tue, 2012-08-21 at 11:28 +0530, Archit Taneja wrote:
>
>> diff --git a/drivers/video/omap2/dss/output.c b/drivers/video/omap2/dss/output.c
>> new file mode 100644
>> index 0000000..034ebbe
>> --- /dev/null
>> +++ b/drivers/video/omap2/dss/output.c
>> @@ -0,0 +1,58 @@
>> +/*
>> + * Copyright (C) 2012 Texas Instruments Ltd
>> + * Author: Archit Taneja <archit@ti.com>
>> + *
>> + * This program is free software; you can redistribute it and/or modify it
>> + * under the terms of the GNU General Public License version 2 as published by
>> + * the Free Software Foundation.
>> + *
>> + * This program is distributed in the hope that it will be useful, but WITHOUT
>> + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
>> + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
>> + * more details.
>> + *
>> + * You should have received a copy of the GNU General Public License along with
>> + * this program.  If not, see <http://www.gnu.org/licenses/>.
>> + */
>> +
>> +#include <linux/kernel.h>
>> +#include <linux/platform_device.h>
>> +#include <linux/slab.h>
>> +
>> +#include <video/omapdss.h>
>> +
>> +#include "dss.h"
>> +
>> +static struct list_head output_list;
>
> You can do:
>
> static LIST_HEAD(output_list);
>
> Then you don't need to initialize it separately.

Oh ok. I'll fix this.

>
>> +
>> +struct omap_dss_output *dss_create_output(struct platform_device *pdev)
>> +{
>> +	struct omap_dss_output *out;
>> +
>> +	out = kzalloc(sizeof(struct omap_dss_output *), GFP_KERNEL);
>> +	if (!out)
>> +		return NULL;
>
> A patch that adds kzalloc but no free is always a bit suspicious =).
>
>> +
>> +	out->pdev = pdev;
>> +
>> +	list_add_tail(&out->list, &output_list);
>> +
>> +	return out;
>> +}
>
> Instead of allocating omap_dss_output here, you could let the caller do
> it, and only initialize it here with default values (if that's even
> needed). Then the caller can use kzalloc, or can just embed the stuct
> into its own data-struct, which may be often a better choice.

So output can be in each interface driver's private data, and we just 
add that to our list of outputs?

>
>> +struct omap_dss_output *omap_dss_get_output(enum omap_dss_output_id id)
>> +{
>> +	struct omap_dss_output *out;
>> +
>> +	list_for_each_entry(out, &output_list, list) {
>> +		if (out->id = id)
>> +			return out;
>> +	}
>> +
>> +	return NULL;
>> +}
>> +
>> +void dss_init_outputs(void)
>> +{
>> +	INIT_LIST_HEAD(&output_list);
>> +}
>> diff --git a/include/video/omapdss.h b/include/video/omapdss.h
>> index b868123..0ba613f 100644
>> --- a/include/video/omapdss.h
>> +++ b/include/video/omapdss.h
>> @@ -207,6 +207,16 @@ enum omap_hdmi_flags {
>>   	OMAP_HDMI_SDA_SCL_EXTERNAL_PULLUP = 1 << 0,
>>   };
>>
>> +enum omap_dss_output_id {
>> +	OMAP_DSS_OUTPUT_DPI	= 1 << 0,
>> +	OMAP_DSS_OUTPUT_DBI	= 1 << 1,
>> +	OMAP_DSS_OUTPUT_SDI	= 1 << 2,
>> +	OMAP_DSS_OUTPUT_DSI1	= 1 << 3,
>> +	OMAP_DSS_OUTPUT_VENC	= 1 << 4,
>> +	OMAP_DSS_OUTPUT_DSI2	= 1 << 5,
>> +	OMAP_DSS_OUTPUT_HDMI	= 1 << 6,
>> +};
>
> I'm not sure about this. We already have enum omap_display_type. If you
> need the instance number, you could have that as a separate int field.
>
> Where do you need the output_id?

output_id is used to take care of situations where there our multiple 
outputs of the same type, like DSI1 and DSI2. An enum helps when we 
check if an overlay manager supports that output instance or not. For 
ex, on OMAP4, LCD1 connects to DSI1 and not DSI2.

I add a func called dss_feat_get_supported_outputs(channel) later to 
check for this. When setting a new output for a manager, we just do an 
'&' to see if the output in question is in the mask of the manager's set 
of supported outputs.

>
>> +
>>   /* RFBI */
>>
>>   struct rfbi_timings {
>> @@ -492,6 +502,24 @@ struct omap_dsi_pin_config {
>>   	int pins[OMAP_DSS_MAX_DSI_PINS];
>>   };
>>
>> +struct omap_dss_output {
>> +	struct list_head list;
>> +
>> +	/* display type supported by the output */
>> +	enum omap_display_type type;
>> +
>> +	/* output instance */
>> +	enum omap_dss_output_id id;
>
> So instead of omap_dss_output_id, you'd have omap_display_type type and
> int id, which together tell the supported output and also the output
> driver instance.
>
>   Tomi
>


WARNING: multiple messages have this Message-ID (diff)
From: Archit Taneja <a0393947@ti.com>
To: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Archit Taneja <archit@ti.com>,
	linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org,
	rob@ti.com, sumit.semwal@ti.com
Subject: Re: [PATCH 01/23] OMAPDSS: outputs: Create a new entity called outputs
Date: Fri, 24 Aug 2012 18:21:52 +0530	[thread overview]
Message-ID: <503778E8.2060909@ti.com> (raw)
In-Reply-To: <1345812069.9287.65.camel@lappyti>

On Friday 24 August 2012 06:11 PM, Tomi Valkeinen wrote:
> On Tue, 2012-08-21 at 11:28 +0530, Archit Taneja wrote:
>
>> diff --git a/drivers/video/omap2/dss/output.c b/drivers/video/omap2/dss/output.c
>> new file mode 100644
>> index 0000000..034ebbe
>> --- /dev/null
>> +++ b/drivers/video/omap2/dss/output.c
>> @@ -0,0 +1,58 @@
>> +/*
>> + * Copyright (C) 2012 Texas Instruments Ltd
>> + * Author: Archit Taneja <archit@ti.com>
>> + *
>> + * This program is free software; you can redistribute it and/or modify it
>> + * under the terms of the GNU General Public License version 2 as published by
>> + * the Free Software Foundation.
>> + *
>> + * This program is distributed in the hope that it will be useful, but WITHOUT
>> + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
>> + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
>> + * more details.
>> + *
>> + * You should have received a copy of the GNU General Public License along with
>> + * this program.  If not, see <http://www.gnu.org/licenses/>.
>> + */
>> +
>> +#include <linux/kernel.h>
>> +#include <linux/platform_device.h>
>> +#include <linux/slab.h>
>> +
>> +#include <video/omapdss.h>
>> +
>> +#include "dss.h"
>> +
>> +static struct list_head output_list;
>
> You can do:
>
> static LIST_HEAD(output_list);
>
> Then you don't need to initialize it separately.

Oh ok. I'll fix this.

>
>> +
>> +struct omap_dss_output *dss_create_output(struct platform_device *pdev)
>> +{
>> +	struct omap_dss_output *out;
>> +
>> +	out = kzalloc(sizeof(struct omap_dss_output *), GFP_KERNEL);
>> +	if (!out)
>> +		return NULL;
>
> A patch that adds kzalloc but no free is always a bit suspicious =).
>
>> +
>> +	out->pdev = pdev;
>> +
>> +	list_add_tail(&out->list, &output_list);
>> +
>> +	return out;
>> +}
>
> Instead of allocating omap_dss_output here, you could let the caller do
> it, and only initialize it here with default values (if that's even
> needed). Then the caller can use kzalloc, or can just embed the stuct
> into its own data-struct, which may be often a better choice.

So output can be in each interface driver's private data, and we just 
add that to our list of outputs?

>
>> +struct omap_dss_output *omap_dss_get_output(enum omap_dss_output_id id)
>> +{
>> +	struct omap_dss_output *out;
>> +
>> +	list_for_each_entry(out, &output_list, list) {
>> +		if (out->id == id)
>> +			return out;
>> +	}
>> +
>> +	return NULL;
>> +}
>> +
>> +void dss_init_outputs(void)
>> +{
>> +	INIT_LIST_HEAD(&output_list);
>> +}
>> diff --git a/include/video/omapdss.h b/include/video/omapdss.h
>> index b868123..0ba613f 100644
>> --- a/include/video/omapdss.h
>> +++ b/include/video/omapdss.h
>> @@ -207,6 +207,16 @@ enum omap_hdmi_flags {
>>   	OMAP_HDMI_SDA_SCL_EXTERNAL_PULLUP = 1 << 0,
>>   };
>>
>> +enum omap_dss_output_id {
>> +	OMAP_DSS_OUTPUT_DPI	= 1 << 0,
>> +	OMAP_DSS_OUTPUT_DBI	= 1 << 1,
>> +	OMAP_DSS_OUTPUT_SDI	= 1 << 2,
>> +	OMAP_DSS_OUTPUT_DSI1	= 1 << 3,
>> +	OMAP_DSS_OUTPUT_VENC	= 1 << 4,
>> +	OMAP_DSS_OUTPUT_DSI2	= 1 << 5,
>> +	OMAP_DSS_OUTPUT_HDMI	= 1 << 6,
>> +};
>
> I'm not sure about this. We already have enum omap_display_type. If you
> need the instance number, you could have that as a separate int field.
>
> Where do you need the output_id?

output_id is used to take care of situations where there our multiple 
outputs of the same type, like DSI1 and DSI2. An enum helps when we 
check if an overlay manager supports that output instance or not. For 
ex, on OMAP4, LCD1 connects to DSI1 and not DSI2.

I add a func called dss_feat_get_supported_outputs(channel) later to 
check for this. When setting a new output for a manager, we just do an 
'&' to see if the output in question is in the mask of the manager's set 
of supported outputs.

>
>> +
>>   /* RFBI */
>>
>>   struct rfbi_timings {
>> @@ -492,6 +502,24 @@ struct omap_dsi_pin_config {
>>   	int pins[OMAP_DSS_MAX_DSI_PINS];
>>   };
>>
>> +struct omap_dss_output {
>> +	struct list_head list;
>> +
>> +	/* display type supported by the output */
>> +	enum omap_display_type type;
>> +
>> +	/* output instance */
>> +	enum omap_dss_output_id id;
>
> So instead of omap_dss_output_id, you'd have omap_display_type type and
> int id, which together tell the supported output and also the output
> driver instance.
>
>   Tomi
>


  reply	other threads:[~2012-08-24 12:53 UTC|newest]

Thread overview: 148+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-21  5:58 [PATCH 00/23] OMAPDSS: Create output entities Archit Taneja
2012-08-21  6:10 ` Archit Taneja
2012-08-21  5:58 ` [PATCH 01/23] OMAPDSS: outputs: Create a new entity called outputs Archit Taneja
2012-08-21  6:10   ` Archit Taneja
2012-08-24 12:41   ` Tomi Valkeinen
2012-08-24 12:41     ` Tomi Valkeinen
2012-08-24 12:51     ` Archit Taneja [this message]
2012-08-24 12:53       ` Archit Taneja
2012-08-29 10:32       ` Tomi Valkeinen
2012-08-29 10:32         ` Tomi Valkeinen
2012-08-29 10:57         ` Archit Taneja
2012-08-29 10:58           ` Archit Taneja
2012-08-21  5:58 ` [PATCH 02/23] OMAPDSS: outputs: Create and initialize output instances Archit Taneja
2012-08-21  6:10   ` Archit Taneja
2012-08-24 13:14   ` Tomi Valkeinen
2012-08-24 13:14     ` Tomi Valkeinen
2012-08-27  6:19     ` Archit Taneja
2012-08-27  6:31       ` Archit Taneja
2012-08-27  6:44       ` Tomi Valkeinen
2012-08-27  6:44         ` Tomi Valkeinen
2012-08-21  5:58 ` [PATCH 03/23] OMAPDSS: output: Add set/unset device ops for omap_dss_output Archit Taneja
2012-08-21  6:10   ` Archit Taneja
2012-08-21  5:58 ` [PATCH 04/23] OMAPDSS: APPLY: Add manager set/unset output ops for omap_overlay_manager Archit Taneja
2012-08-21  6:10   ` Archit Taneja
2012-08-21  5:58 ` [PATCH 05/23] OMAPDSS: Remove manager->device references Archit Taneja
2012-08-21  6:10   ` Archit Taneja
2012-08-21  5:58 ` [PATCH 06/23] OMAP_VOUT: " Archit Taneja
2012-08-21  6:10   ` Archit Taneja
2012-08-21  5:58 ` [PATCH 07/23] OMAPFB: remove " Archit Taneja
2012-08-21  6:10   ` Archit Taneja
2012-08-21  5:58 ` [PATCH 08/23] OMAPDRM: Remove " Archit Taneja
2012-08-21  6:10   ` Archit Taneja
2012-08-21  5:58 ` [PATCH 09/23] OMAPDSS: Create links between managers, outputs and devices Archit Taneja
2012-08-21  6:10   ` Archit Taneja
2012-08-21  5:58 ` [PATCH 10/23] OMAPDSS: DPI: Pass outputs from panel driver to DPI interface driver Archit Taneja
2012-08-21  6:10   ` Archit Taneja
2012-08-21  5:58 ` [PATCH 11/23] OMAPDSS: DSI: Remove dsi_pdev_map global struct Archit Taneja
2012-08-21  6:10   ` Archit Taneja
2012-08-21  5:58 ` [PATCH 12/23] OMAPDSS: DSI: Pass outputs from panel driver to DSI interface driver Archit Taneja
2012-08-21  6:10   ` Archit Taneja
2012-08-21  5:58 ` [PATCH 13/23] OMAPDSS: SDI: Pass outputs from panel driver to SDI " Archit Taneja
2012-08-21  6:10   ` Archit Taneja
2012-08-21  5:58 ` [PATCH 14/23] OMAPDSS: RFBI: Pass outputs from panel driver to RFBI " Archit Taneja
2012-08-21  6:10   ` Archit Taneja
2012-08-21  5:58 ` [PATCH 15/23] OMAPDSS: RFBI: Add output pointers as arguments to all exported functions Archit Taneja
2012-08-21  6:10   ` Archit Taneja
2012-08-21  5:58 ` [PATCH 16/23] OMAPDSS: VENC: Pass outputs from panel driver to VENC interface driver Archit Taneja
2012-08-21  6:10   ` Archit Taneja
2012-08-21  5:58 ` [PATCH 17/23] OMAPDSS: HDMI: Pass outputs from panel driver to HDMI " Archit Taneja
2012-08-21  6:10   ` Archit Taneja
2012-08-21  5:58 ` [PATCH 18/23] OMAPDSS: HDMI: Add output pointers as arguments to all functions used by hdmi panel driver Archit Taneja
2012-08-21  6:10   ` [PATCH 18/23] OMAPDSS: HDMI: Add output pointers as arguments to all functions used by hdmi panel dr Archit Taneja
2012-08-21  5:58 ` [PATCH 19/23] OMAPDSS/OMAPFB: Change dssdev->manager references Archit Taneja
2012-08-21  6:10   ` Archit Taneja
2012-08-21  5:58 ` [PATCH 20/23] OMAPDSS: MANAGER: Update display sysfs store Archit Taneja
2012-08-21  6:10   ` Archit Taneja
2012-08-21  5:58 ` [PATCH 21/23] OMAPDSS: MANAGER: Get device via output Archit Taneja
2012-08-21  6:10   ` Archit Taneja
2012-08-21  5:58 ` [PATCH 22/23] OMAPDSS: APPLY: Remove omap_dss_device references from dss_ovl_enable/disable Archit Taneja
2012-08-21  6:10   ` Archit Taneja
2012-08-21  5:58 ` [PATCH 23/23] OMAPDSS: Remove old way of setting manager and device links Archit Taneja
2012-08-21  6:10   ` Archit Taneja
2012-08-30 11:40 ` [PATCH v2 00/23] OMAPDSS: Create output entities Archit Taneja
2012-08-30 11:52   ` Archit Taneja
2012-08-30 11:40   ` [PATCH v2 01/23] OMAPDSS: outputs: Create a new entity called outputs Archit Taneja
2012-08-30 11:52     ` Archit Taneja
2012-08-30 11:40   ` [PATCH v2 02/23] OMAPDSS: outputs: Create and register output instances Archit Taneja
2012-08-30 11:52     ` Archit Taneja
2012-08-31 11:57     ` Tomi Valkeinen
2012-08-31 11:57       ` Tomi Valkeinen
2012-08-31 12:03       ` Archit Taneja
2012-08-31 12:15         ` Archit Taneja
2012-08-30 11:40   ` [PATCH v2 03/23] OMAPDSS: output: Add set/unset device ops for omap_dss_output Archit Taneja
2012-08-30 11:52     ` Archit Taneja
2012-08-31 12:03     ` Tomi Valkeinen
2012-08-31 12:03       ` Tomi Valkeinen
2012-08-31 12:24       ` Archit Taneja
2012-08-31 12:36         ` Archit Taneja
2012-08-31 12:28         ` Tomi Valkeinen
2012-08-31 12:28           ` Tomi Valkeinen
2012-08-30 11:40   ` [PATCH v2 04/23] OMAPDSS: APPLY: Add manager set/unset output ops for omap_overlay_manager Archit Taneja
2012-08-30 11:52     ` Archit Taneja
2012-08-30 11:40   ` [PATCH v2 05/23] OMAPDSS: Remove manager->device references Archit Taneja
2012-08-30 11:52     ` Archit Taneja
2012-08-30 11:40   ` [PATCH v2 06/23] OMAP_VOUT: " Archit Taneja
2012-08-30 11:52     ` Archit Taneja
2012-08-31 12:11     ` Tomi Valkeinen
2012-08-31 12:11       ` Tomi Valkeinen
2012-08-31 12:34       ` Archit Taneja
2012-08-31 12:46         ` Archit Taneja
2012-08-30 11:40   ` [PATCH v2 07/23] OMAPFB: remove " Archit Taneja
2012-08-30 11:52     ` Archit Taneja
2012-08-30 11:40   ` [PATCH v2 08/23] OMAPDRM: Remove " Archit Taneja
2012-08-30 11:52     ` Archit Taneja
2012-08-30 11:40   ` [PATCH v2 09/23] OMAPDSS: Create links between managers, outputs and devices Archit Taneja
2012-08-30 11:52     ` Archit Taneja
2012-08-31 14:10     ` Tomi Valkeinen
2012-08-31 14:10       ` Tomi Valkeinen
2012-08-31 14:24       ` Archit Taneja
2012-08-31 14:36         ` Archit Taneja
2012-08-31 14:45         ` Tomi Valkeinen
2012-08-31 14:45           ` Tomi Valkeinen
2012-08-31 15:08           ` Tomi Valkeinen
2012-08-31 15:08             ` Tomi Valkeinen
2012-09-03  9:26             ` Archit Taneja
2012-09-03  9:38               ` Archit Taneja
2012-09-03  9:35               ` Tomi Valkeinen
2012-09-03  9:35                 ` Tomi Valkeinen
2012-08-30 11:40   ` [PATCH v2 10/23] OMAPDSS: DPI: Pass omap_dss_output within the driver Archit Taneja
2012-08-30 11:52     ` Archit Taneja
2012-08-31 13:48     ` Tomi Valkeinen
2012-08-31 13:48       ` Tomi Valkeinen
2012-08-31 13:59       ` Archit Taneja
2012-08-31 14:00         ` Archit Taneja
2012-08-30 11:40   ` [PATCH v2 11/23] OMAPDSS: DSI: Remove dsi_pdev_map global struct Archit Taneja
2012-08-30 11:52     ` Archit Taneja
2012-08-30 11:40   ` [PATCH v2 12/23] OMAPDSS: DSI: Pass omap_dss_output within the driver Archit Taneja
2012-08-30 11:52     ` Archit Taneja
2012-08-30 11:40   ` [PATCH v2 13/23] OMAPDSS: SDI: " Archit Taneja
2012-08-30 11:52     ` Archit Taneja
2012-08-30 11:40   ` [PATCH v2 14/23] OMAPDSS: RFBI: " Archit Taneja
2012-08-30 11:52     ` Archit Taneja
2012-08-30 11:40   ` [PATCH v2 15/23] OMAPDSS: RFBI: Add dssdev pointers as arguments to all exported functions Archit Taneja
2012-08-30 11:52     ` Archit Taneja
2012-08-31 14:20     ` Tomi Valkeinen
2012-08-31 14:20       ` Tomi Valkeinen
2012-08-31 14:30       ` Archit Taneja
2012-08-31 14:42         ` Archit Taneja
2012-08-30 11:40   ` [PATCH v2 16/23] OMAPDSS: VENC: Pass omap_dss_output within the driver Archit Taneja
2012-08-30 11:52     ` Archit Taneja
2012-08-30 11:40   ` [PATCH v2 17/23] OMAPDSS: HDMI: " Archit Taneja
2012-08-30 11:52     ` Archit Taneja
2012-08-30 11:40   ` [PATCH v2 18/23] OMAPDSS: HDMI: Add dssdev pointer as an argument to all functions used by hdmi panel driver Archit Taneja
2012-08-30 11:52     ` [PATCH v2 18/23] OMAPDSS: HDMI: Add dssdev pointer as an argument to all functions used by hdmi pane Archit Taneja
2012-08-30 11:40   ` [PATCH v2 19/23] OMAPDSS/OMAPFB: Change dssdev->manager references Archit Taneja
2012-08-30 11:52     ` Archit Taneja
2012-08-30 11:40   ` [PATCH v2 20/23] OMAPDSS: MANAGER: Update display sysfs store Archit Taneja
2012-08-30 11:52     ` Archit Taneja
2012-08-31 14:30     ` Tomi Valkeinen
2012-08-31 14:30       ` Tomi Valkeinen
2012-08-31 14:41       ` Archit Taneja
2012-08-31 14:53         ` Archit Taneja
2012-08-30 11:40   ` [PATCH v2 21/23] OMAPDSS: MANAGER: Get device via output Archit Taneja
2012-08-30 11:52     ` Archit Taneja
2012-08-30 11:40   ` [PATCH v2 22/23] OMAPDSS: APPLY: Remove omap_dss_device references from dss_ovl_enable/disable Archit Taneja
2012-08-30 11:52     ` Archit Taneja
2012-08-30 11:40   ` [PATCH v2 23/23] OMAPDSS: Remove old way of setting manager and device links Archit Taneja
2012-08-30 11:52     ` Archit Taneja

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=503778E8.2060909@ti.com \
    --to=a0393947@ti.com \
    --cc=archit@ti.com \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=rob@ti.com \
    --cc=sumit.semwal@ti.com \
    --cc=tomi.valkeinen@ti.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.